summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2016-03-02 21:22:35 +0100
committerArmin Rigo <arigo@tunes.org>2016-03-02 21:22:35 +0100
commit53964a414e0c5de4c82fd45d36123e3af22681b5 (patch)
treee2cdefaafb7864a76a69ae5ea3665ab625b14b5d
parentcf7c56209b5a6b189a0be3612a02662dba73f62f (diff)
downloadcffi-53964a414e0c5de4c82fd45d36123e3af22681b5.tar.gz
Oops, tests fail if we run them one by one
-rw-r--r--testing/embedding/test_basic.py9
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