Skip to content

'pytest -v' shows full path on Windows when pytest.ini is on substituted drive #7333

@thorstenkampe

Description

@thorstenkampe
  • a detailed description of the bug or suggestion
  • platform win32 -- Python 3.8.3, pytest-5.4.3, py-1.8.1, pluggy-0.13.1
  • minimal example if possible

The subject says it all: pytest on Windows shows full path of the test file in verbose mode when there is a pytest.ini in the current directory and the directory is on a substituted drive:

> pwd
Path
----
F:\cygwin\home\thorsten\python\modules

> pytest -v
platform win32 -- Python 3.8.3, pytest-5.4.3, py-1.8.1, pluggy-0.13.1 -- f:\scoop\apps\python\current\python.exe
cachedir: .pytest_cache
rootdir: C:\data\flash drive\cygwin\home\thorsten\python\modules
collected 32 items

test_toolbox.py::test_assert_installed PASSED
test_toolbox.py::Test_get_version::test_1 PASSED
test_toolbox.py::Test_get_version::test_2 PASSED
> touch pytest.ini
> pytest -v
platform win32 -- Python 3.8.3, pytest-5.4.3, py-1.8.1, pluggy-0.13.1 -- f:\scoop\apps\python\current\python.exe
cachedir: .pytest_cache
rootdir: F:\cygwin\home\thorsten\python\modules, inifile: pytest.ini
collected 32 items

F:\cygwin\home\thorsten\python\modules\test_toolbox.py::test_assert_installed PASSED
F:\cygwin\home\thorsten\python\modules\test_toolbox.py::Test_get_version::test_1 PASSED
F:\cygwin\home\thorsten\python\modules\test_toolbox.py::Test_get_version::test_2 PASSED

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: collectionrelated to the collection phasetopic: reportingrelated to terminal output and user-facing messages and errors

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions