Author: Philip Jenvey <[email protected]>
Branch: py3.3
Changeset: r72588:ecd762272c96
Date: 2014-07-27 18:11 -0700
http://bitbucket.org/pypy/pypy/changeset/ecd762272c96/

Log:    fix space.sys.debug tweak leaking outside of these tests

diff --git a/pypy/module/__builtin__/test/test_compile.py 
b/pypy/module/__builtin__/test/test_compile.py
--- a/pypy/module/__builtin__/test/test_compile.py
+++ b/pypy/module/__builtin__/test/test_compile.py
@@ -84,11 +84,18 @@
 class TestOptimizeO:
     """Test interaction of -O flag and optimize parameter of compile."""
 
+    def setup_method(self, method):
+        space = self.space
+        self._sys_debug = space.sys.debug
+        # imitate -O
+        space.sys.debug = False
+
+    def teardown_method(self, method):
+        self.space.sys.debug = self._sys_debug
+
     def test_O_optmize_0(self):
         """Test that assert is not ignored if -O flag is set but optimize=0."""
         space = self.space
-        space.sys.debug = False  # imitate -O
-
         w_res = space.appexec([], """():
             assert False  # check that our -O imitation hack works
             try:
@@ -103,8 +110,6 @@
     def test_O_optimize__1(self):
         """Test that assert is ignored with -O and optimize=-1."""
         space = self.space
-        space.sys.debug = False  # imitate -O
-
         space.appexec([], """():
             exec(compile('assert False', '', 'exec', optimize=-1))
         """)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to