While working on src_test for x11-wm/herbstluftwm I found that I had to export PYTHONPATH before pytest invoked in python_test() would pick the path up. I am not sure why this appears to be the first ebuild where, after calling distutils_install_for_testing(), PYTHONPATH had to be exported. I can only speculate that this is maybe because PYTHONPATH was already exported somehow when distutils_install_for_testing() was invoked. Reproducible: Always
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1fa0ed9fd7fb3abbd6b2fd5f7f6b6ec638742bf7 commit 1fa0ed9fd7fb3abbd6b2fd5f7f6b6ec638742bf7 Author: Florian Schmaus <flow@gentoo.org> AuthorDate: 2021-07-12 07:24:53 +0000 Commit: Florian Schmaus <flow@gentoo.org> CommitDate: 2021-07-12 07:24:53 +0000 x11-wm/herbstluftwm: use distutils_install_for_testing in src_test Bug: https://bugs.gentoo.org/801658 Signed-off-by: Florian Schmaus <flow@gentoo.org> x11-wm/herbstluftwm/herbstluftwm-0.9.3.ebuild | 7 +++++++ x11-wm/herbstluftwm/herbstluftwm-9999.ebuild | 7 +++++++ 2 files changed, 14 insertions(+)
Didn't you get my reply on IRC? You can't expect Python to work unless you're in Python environment that's run via python_foreach_impl or python_setup. In this case, you need to call distutils-r1_src_test from your src_test, and do all the logic inside python_test.