FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: Allow loading cases for tests.py by last-partizan · Pull Request #344 · smarie/python-pytest-cases · GitHub

fix: Allow loading cases for tests.py - #344

Open
last-partizan wants to merge 6 commits into
smarie:mainfrom
last-partizan:cases-location-fix
Open

fix: Allow loading cases for tests.py#344
last-partizan wants to merge 6 commits into
smarie:mainfrom
last-partizan:cases-location-fix

Conversation

last-partizan commented Jun 1, 2024
edited by smarie
Loading

Copy link
Copy Markdown

Fixes #366

Hi, i noticed that after updating to 3.8.5 this package stopped loading cases from tests_cases.py.

This PR fixes it.

Can this be accepted? Or it's better for me to rename my tests.py to test_something.py?

Copy link
Copy Markdown
Author

@smarie Please, review this.

Comment thread tests/cases/issues/issue_309/tests.py Outdated

smarie commented Aug 25, 2025

Copy link
Copy Markdown
Owner

Hi @last-partizan , I looked at your PR and slightly improved it.

Now my problem is that the test does not seem to run at all :)

Could it be that this correspond to an old behaviour from pytest ? Maybe pytest does not run anymore a collected file that is named tests.py .

Copy link
Copy Markdown
Author

Yes. It seems to be the case.

By default, files matching test_*.py and *_test.py will be considered test modules.

I think pytest never collected tests.py by default, but I have this configured in pytest.ini

python_files = tests.py test_*.py *_tests.py

Comment thread setup.cfg
# pytest default configuration
[tool:pytest]
testpaths = tests/
python_files = tests.py test_*.py *_tests.py

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I have added same config option here, if that's okay.

last-partizan requested a review from smarie September 1, 2025 08:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Successfully merging this pull request may close these issues.

Allow loading cases for tests.py

2 participants


Back | FazBrowse Home | New Git URL