Skip to content

Conversation

last-partizan
Copy link

@last-partizan last-partizan commented Jun 1, 2024

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?

@last-partizan
Copy link
Author

@smarie Please, review this.

@smarie
Copy link
Owner

smarie commented Aug 25, 2025

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 .

@last-partizan
Copy link
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

@@ -87,6 +87,7 @@ test = pytest
# pytest default configuration
[tool:pytest]
testpaths = tests/
python_files = tests.py test_*.py *_tests.py
Copy link
Author

Choose a reason for hiding this comment

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

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

@last-partizan last-partizan requested a review from smarie September 1, 2025 08:46
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