3

I have a series of unit tests that are meant to run in two contexts:

1) On a buildbot server 2) in developer's home environments

In both our development procedure and in the buildbot server we use virtualenv. The tests run fine in the developer environments, but with buildbot the tests are being run from the python executable in the virtualenv without activating the virtualenv.

This works out for most tests, but there are a few that shell out to run scripts, and I want them to run the scripts with the virtualenv's python executable. Is there a way to pull the path to the current python executable inside the tests themselves to build the shell commands that way?

1
  • Oops, wrong dupe. The correct one Commented Jul 29, 2014 at 20:08

1 Answer 1

2

The current python executable is always available as sys.executable, which should give full path (but you can ensure this using os.path functions).

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.