diff options
author | Armin Rigo <arigo@tunes.org> | 2016-03-02 21:22:35 +0100 |
---|---|---|
committer | Armin Rigo <arigo@tunes.org> | 2016-03-02 21:22:35 +0100 |
commit | 53964a414e0c5de4c82fd45d36123e3af22681b5 (patch) | |
tree | e2cdefaafb7864a76a69ae5ea3665ab625b14b5d | |
parent | cf7c56209b5a6b189a0be3612a02662dba73f62f (diff) | |
download | cffi-53964a414e0c5de4c82fd45d36123e3af22681b5.tar.gz |
Oops, tests fail if we run them one by one
-rw-r--r-- | testing/embedding/test_basic.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/testing/embedding/test_basic.py b/testing/embedding/test_basic.py index ec5f22b..91ae5e5 100644 --- a/testing/embedding/test_basic.py +++ b/testing/embedding/test_basic.py @@ -32,8 +32,12 @@ def prefix_pythonpath(): pythonpath.insert(0, cffi_base) return os.pathsep.join(pythonpath) -def setup_module(mod): - mod.org_env = os.environ.copy() +def copy_away_env(): + global org_env + try: + org_env + except NameError: + org_env = os.environ.copy() class EmbeddingTests: @@ -121,6 +125,7 @@ class EmbeddingTests: os.chdir(curdir) def patch_environment(self): + copy_away_env() path = self.get_path() # for libpypy-c.dll or Python27.dll path = os.path.split(sys.executable)[0] + os.path.pathsep + path |