pytest-bdd icon indicating copy to clipboard operation
pytest-bdd copied to clipboard

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

Open AliHezarpisheh opened this issue 1 year ago • 2 comments
trafficstars

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!

AliHezarpisheh avatar Jan 10 '24 08:01 AliHezarpisheh

Please provide an MVCE to reproduce the issue.

youtux avatar Jan 21 '24 14:01 youtux

  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.

AliHezarpisheh avatar Apr 28 '24 13:04 AliHezarpisheh