Author: Antonio Cuni <[email protected]>
Branch: 
Changeset: r46974:94aca11cba52
Date: 2011-09-01 10:33 +0200
http://bitbucket.org/pypy/pypy/changeset/94aca11cba52/

Log:    use pytest's monkeypatching instead of manually doing it

diff --git a/pypy/jit/backend/x86/test/test_runner.py 
b/pypy/jit/backend/x86/test/test_runner.py
--- a/pypy/jit/backend/x86/test/test_runner.py
+++ b/pypy/jit/backend/x86/test/test_runner.py
@@ -433,7 +433,7 @@
                 ops_offset[operations[2]] <=
                 ops_offset[None])
 
-    def test_calling_convention(self):
+    def test_calling_convention(self, monkeypatch):
         if WORD != 4:
             py.test.skip("32-bit only test")
         from pypy.jit.backend.x86.regloc import eax, edx
@@ -442,7 +442,7 @@
         from pypy.rlib.libffi import types, clibffi
         had_stdcall = hasattr(clibffi, 'FFI_STDCALL')
         if not had_stdcall:    # not running on Windows, but we can still test
-            clibffi.FFI_STDCALL = 12345
+            monkeypatch.setattr(clibffi, 'FFI_STDCALL', 12345, raising=False)
         #
         for ffi in [clibffi.FFI_DEFAULT_ABI, clibffi.FFI_STDCALL]:
             cpu = self.cpu
@@ -514,9 +514,6 @@
             assert self.cpu.get_latest_value_int(2) == 42
             assert self.cpu.get_latest_value_int(3) == 42
 
-        if not had_stdcall:
-            del clibffi.FFI_STDCALL
-
 
 class TestDebuggingAssembler(object):
     def setup_method(self, meth):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to