~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

(gz) Propogate site.USER_BASE in selftest run_bzr_subprocess to keep the
 same sys.path (Martin Packman)

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
import random
37
37
import re
38
38
import shlex
 
39
import site
39
40
import stat
40
41
import subprocess
41
42
import sys
2184
2185
 
2185
2186
        if env_changes is None:
2186
2187
            env_changes = {}
 
2188
        # Because $HOME is set to a tempdir for the context of a test, modules
 
2189
        # installed in the user dir will not be found unless $PYTHONUSERBASE
 
2190
        # gets set to the computed directory of this parent process.
 
2191
        if site.USER_BASE is not None:
 
2192
            env_changes["PYTHONUSERBASE"] = site.USER_BASE
2187
2193
        old_env = {}
2188
2194
 
2189
2195
        def cleanup_environment():