Conftest file is loaded multiple times #13296
Labels
platform: windows
windows platform-specific problem
topic: config
related to config handling, argument parsing and config file
Dear Pytest team,
I’ve encountered a bug on Windows where conftest.py is loaded multiple times if the path to the test files is specified with differing case on a case-insensitive file system. This behavior triggers the following error (on minimal reproduction example) -
ValueError: option names {'--dummy-option'} already added
Minimal reproduction example:
pytest_bug.zip
Steps to reproduce:
unzip pytest_bug.zip
python -m pytest .\pytest_bug\Reproducer\
(note that running
python -m pytest .\pytest_bug\reproducer\
will finish with 0 collected tests as expected)Pip list output and OS version
OS version: Windows 11
Python Version: 3.12.9
Potentional fix
Resolving the path fixes the issue, but I am not sure whether it might not have impact on something else.
Thank you.
The text was updated successfully, but these errors were encountered: