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.
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:After some debugging I found, that initially
--override-inioptions are ignored andpython_filesare cached with default values, then ofter some time--override-inibecomes available, butpython_filesalready have cached values and ignores--override-ini.But if I add
pytest.ini:Then this test file is collected.