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

py.test "--override-ini=python_files=*_tests.py" does not work #2238

Closed
sirex opened this issue Feb 7, 2017 · 0 comments
Closed

py.test "--override-ini=python_files=*_tests.py" does not work #2238

sirex opened this issue Feb 7, 2017 · 0 comments

Comments

@sirex
Copy link

@sirex sirex commented Feb 7, 2017

You can use this sandbox to reproduce the error: https://gist.github.com/sirex/1bf7dda1cc3ba14ce7ebb6f964bf0d39

Sandbox contains module_tests.py, but if I run following command this test is not discovered:

> py.test -o "python_files=*_tests.py"
==================================================================== test session starts =====================================================================
platform linux2 -- Python 2.7.12, pytest-3.0.6, py-1.4.32, pluggy-0.4.0
rootdir: /tmp/pytest/pytest, inifile: 
collected 0 items 

After some debugging I found, that initially --override-ini options are ignored and python_files are cached with default values, then ofter some time --override-ini becomes available, but python_files already have cached values and ignores --override-ini.

But if I add pytest.ini:

> cat pytest.ini 
[pytest]
python_files=*_tests.py

Then this test file is collected.

nicoddemus added a commit to nicoddemus/pytest that referenced this issue Feb 9, 2017
nicoddemus added a commit to nicoddemus/pytest that referenced this issue Feb 9, 2017
This was referenced Mar 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants