Skip to content

Fixtures not found in Windows Server 2019 after upgrade to Pytest v5.4.1 #6964

Open
@muzomer

Description

@muzomer

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform: windowswindows platform-specific problemtopic: fixturesanything involving fixtures directly or indirectlytype: bugproblem that needs to be addressedtype: regressionindicates a problem that was introduced in a release which was working previously

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions