[TIP] Bug when testing nested virtual environments under Tox

André Caron andre.l.caron at gmail.com
Sun Jan 17 20:09:04 PST 2016


Hi all,

I hit this really weird issue today and I'm hoping someone on this list can
help.

I'm working on a Python program that will remotely run Heroku-style apps
(pet experiment :-).

This program needs to:
1) download the app's source code archive (zip, tar, etc.);
2) unpack the application source archive;
3) create a new virtual environment;
4) install dependencies;
5) run the command specified in the Procfile.

I have something that works, but step #4 consistently fails in the test
suite when run under Tox.

After a bit of digging, it seems that the virtual environment generated in
step #3 is in a strange state: the activate script is not executable and
pip is missing.

In the hope of understanding what's wrong, I got the simplest possible
example that demonstrates the issue.  I have a Bash script that works, a
simple Python script that works and a minimalist Tox project that fails.

I put up a project on GitHub with these in order to share them with anybody
who might be able to help.   Here is the link:

- https://github.com/AndreLouisCaron/nested-venv-bug

AFAICT, these recipes are all equivalent, but the Tox project fails for me
(tried with Tox 1.9 and 2.3.1 with same results).

Since it only fails under Tox, I'm assuming Tox is doing something that
affects the behavior of virtual environment creation, but I can't figure
out what.

If anybody can take a few minutes to check out the project, try the scripts
and give me a few ideas, no matter how crazy they sound, I'd be **really**
grateful :-)

Thanks!

André
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20160117/1a0bcac5/attachment.html>


More information about the testing-in-python mailing list