Description
Thanks for your efforts on the great pytest
framework. We are using it to test most of our modules. And it works perfectly. Recently, we started using Pytest v5.4.1
in our tests, unfortunately, we observed issues related to fixtures defined in conftest.py
files in Windows Server 2019
(Linux and MacOS are perfectly fine)
Background:
We are using Pytest v4.1.1
with Python 3.6.5
to test some internal packages. Below is the directory structure:
.
├── mypy.ini
├── setup.cfg
├── setup.py
├── tests
│ ├── __init__.py
│ └── unit
│ ├── conftest.py
│ ├── test_project.py
│
├── tox.ini
Unit tests are executed using tox
, which uses the below command:
pytest -v -rs --color=yes tests/unit
Tests used to PASS
successfully using Pytest v4.1.1
, but after the upgrade to Pytest v5.4.1
, now tests FAIL because test files are not able to see the fixtures defined in conftest.py
file:
E fixture 'proj_latest_p4d' not found
Tests now PASS
only when we use the --rootdir
option as below:
pytest -v -rs --color=yes tests/unit --rootdir=tests/unit