Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with pytest-bdd Failing to Identify Correct Scenario Path After Folder Name Change #667

Open
AliHezarpisheh opened this issue Jan 10, 2024 · 2 comments

Comments

@AliHezarpisheh
Copy link

After renaming folders in my project, I encountered an issue with pytest-bdd. It seems to struggle in locating the correct path, persistently searching for scenarios in the last path, which no longer exists.

Investigation:
Initially, I suspected caching problems. However, even after clearing the pytest cache, the error persisted. To further investigate, I played around with different folder names, and eventually, pytest successfully identified the existing folder.

Observation:
This behavior suggests that there might be an underlying issue in pytest-bdd related to handling folder name changes, extending beyond a simple caching problem.

Steps to Reproduce:

Rename folders in the project.
Run pytest to search for feature files.
Observe the search behavior.
Expected Behavior:
pytest-bdd should accurately identify the path even after folder name changes.

Additional Information:
If needed, I can provide more details or steps to reproduce the problem.

Appreciate your attention to this matter!

@youtux
Copy link
Contributor

youtux commented Jan 21, 2024

Please provide an MVCE to reproduce the issue.

@AliHezarpisheh
Copy link
Author

  1. Create a directory structure with nested folders containing feature files.
  2. Rename one or more of these folders.
  3. Run pytest-bdd to search for feature files within the project.
  4. After renaming the folders, rerun pytest-bdd to observe its behavior.
  5. Observe pytest-bdd's behavior in locating the feature files, specifically how it handles the renamed folders.

Additionally, I've found that deleting the pycache folders resolves this issue. You may want to try this step as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants