New review comment by tornaria on void-packages repository https://github.com/void-linux/void-packages/pull/44268#discussion_r1218351910 Comment: > The problem isn't that this works in a `venv`, it's how you're calling `pytest`. The default `do_build` runs `pytest3` but you are running `python3 -m pytest`, which means you add `.` to the Python path by default. I see, it's really misleading that the python path changes depending on this. > If you were to run > > ```shell > ln -Tsf /usr/bin/pytest3 "${testdir}/bin/pytest3" > "${testdir}/bin/pytest3" > ``` > > instead of `python3 -m pytest`, the tests would again fail with an inability to find `IPython`. I don' t think that will run pytest in the venv, since the shebang for `/usr/bin/pytest3` is `/usr/bin/python3`. It does what you claim if I do something like ``` "${testdir}/bin/python3" /usr/bin/pytest3 ``` so TIL that `python3 -m pytest` is not the same as `python3 /usr/bin/pytest`. > This suggests that `pytest` is not actually testing against the contents of the wheel, but is instead testing the contents of the source tree. Sure and since all the test files are actually installed in the wheel, we get a conflict between the files pytest is trying to load (from `.`) and the modules that are installed in `$testdir`. So an easy way to make `.` into the python path would be ``` make_check_pre='env PYTHONPATH=.' ``` With this in place and the standard `do_check()`, all tests pass (even `test_ipython_embed`). What do you think?