We found in a hard way that pytest is not playing along nicely with autoconf (or any tool which might use conftest* “file namespace” for their own purposes, as autoconf clobbers the conftest* files in the project’s root/build directory.
It’s true that autoconf is not universally loved, but OTOH even cpython is using it!
IMHO pytest ought to fix this, as otherwise it’s kind of “move fast and break things” attitude FOSS doesn’t appreciate, besides being pain in the neck to work around. I am interested to hear the list’s opinions on this.
Unfair? 20 years of breaking de facto standards don’t look good. Besides, autoconf was creating and compiling conftest.c files (and then doing rm -f conftest*) back in 1990 or so.
conftest.py files are well established in pytest since its inception, it is something really hard to change without breaking thousands of test suites downstream.
I suggest just moving the tests and the conftest.py files to a tests subdirectory, this seems to be a reasonable workaround.
nobody asked for conftest.py to be renamed. What was asked, and promptly dismissed (“not sensible for pytest to accommodate autoconf” (!)), was a possibility to have an alternative name for conftest.py, outside of the namespace clobbered by ./configure and libtool scripts.
We don’t even have tests/ - our doctests (and a number of specific tests run by pytest) are scattered across the repo. We tried to move conftest.py to src/, but it didn’t work for some reason.
Hmm. Well a conftest.py file is just a normal plugin, which pytest loads automatically.
Perhaps you can rename conftest.py to something else (say myfixtures.py), put it somewhere that is importable by pytest, then execute pytest -p myfixtures.