pytest-lazy-fixtures is a pytest plugin and registers itself through the Python entrypoints mechanism. In its unitests, it assumes that this registration has already happened but during dh_auto_test there is no .egg-info directory available. I could use "python3 setup.py develop -x" to generate it, but this registers the package in /usr inside the build chroot which I think is not the best solution.
pytest also has a mechanism to register plugins through an environment variable, but I couldn't figure out how to get the test suite to work
with that.
Hi,
I'm working on src:pytest-lazy-fixtures and was trying to get the
unittests to run but it seems that I have run into a problem that I'm
not sure on how to fix it in a clean way.
pytest-lazy-fixtures is a pytest plugin and registers itself through the Python entrypoints mechanism. In its unitests, it assumes that this registration has already happened but during dh_auto_test there is no .egg-info directory available. I could use "python3 setup.py develop -x"
to generate it, but this registers the package in /usr inside the build chroot which I think is not the best solution.
Is there an other, less intrusive way to register the entrypoint before running the tests?
Thanks,
Michael
Hi,
I'm working on src:pytest-lazy-fixtures and was trying to get the unittests to run but it seems that I have run into a problem that I'm not sure on how to fix it in a clean way.
pytest-lazy-fixtures is a pytest plugin and registers itself through the Python entrypoints mechanism. In its unitests, it assumes that this registration has already happened but during dh_auto_test there is no .egg-info directory available. I could use "python3 setup.py develop -x" to generate it, but this registers the package in /usr inside the build chroot which I think is not the best solution.
Is there an other, less intrusive way to register the entrypoint before running the tests?
I am a bit late, but nobody in this thread mentioned debian/pybuild.testfiles.
It is a list of files or directories that pybuild will copy to its build directory before running the tests, and delete after running them.
If you have *.egg-info in the orig tarball, just add that file (and the tests directory itself) to debian/pybuild.testfiles.
If no, also add this line to debian/rules:
export PYBUILD_BEFORE_TEST={interpreter} setup.py egg_info
If no, also add this line to debian/rules:
export PYBUILD_BEFORE_TEST={interpreter} setup.py egg_info
That seems like the best/most elegant solution to me. Thanks for sharing! So d/pybuild.testfiles is taken into account after PYBUILD_BEFORE_TEST?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 379 |
Nodes: | 16 (2 / 14) |
Uptime: | 71:27:20 |
Calls: | 8,084 |
Calls today: | 2 |
Files: | 13,069 |
Messages: | 5,849,952 |