Using pytest to check the v0.20.3 release while building for Arch Linux turns up the folowing issue:
============================= test session starts ==============================
platform linux -- Python 3.11.8, pytest-8.1.1, pluggy-1.4.0
rootdir: /build/python-graphviz/src/graphviz-0.20.3
configfile: setup.cfg
plugins: mock-3.12.0
collected 329 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting tests/conftest.py ______________________
import file mismatch:
imported module 'conftest' has this __file__ attribute:
/build/python-graphviz/src/graphviz-0.20.3/tests/backend/conftest.py
which is not the same as the test file we want to collect:
/build/python-graphviz/src/graphviz-0.20.3/tests/conftest.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.18s ===============================
It looks like the module names should be fixed to be unique so this isn't an issue. It can probably be avoided by moving the build artifacts to a different location than the test sources, but this shouldn't be an issue in the first place.
I originally opened this issue on the wrong repository and a commenter on that issue suggested it is valid to have a conftest.py. I don't know how it's supposed to work and they are probably right, but some aspect of namespacing / isolation / test configuration is off here.
Using pytest to check the v0.20.3 release while building for Arch Linux turns up the folowing issue:
It looks like the module names should be fixed to be unique so this isn't an issue. It can probably be avoided by moving the build artifacts to a different location than the test sources, but this shouldn't be an issue in the first place.
I originally opened this issue on the wrong repository and a commenter on that issue suggested it is valid to have a
conftest.py
. I don't know how it's supposed to work and they are probably right, but some aspect of namespacing / isolation / test configuration is off here.