Author: Remi Meier <[email protected]>
Branch: stmgc-c8
Changeset: r85902:ab0a5dbd55a0
Date: 2016-07-29 14:37 +0200
http://bitbucket.org/pypy/pypy/changeset/ab0a5dbd55a0/
Log: make the previous test correct (use monkeypatch)
diff --git a/pypy/module/pypystm/test/test_local.py
b/pypy/module/pypystm/test/test_local.py
--- a/pypy/module/pypystm/test/test_local.py
+++ b/pypy/module/pypystm/test/test_local.py
@@ -13,7 +13,7 @@
""")
-def test_direct_call_to_become_inevitable():
+def test_direct_call_to_become_inevitable(monkeypatch):
# this test directly checks if we call rstm.become_inevitable() in the
# right places (before modifying the real threadlocal). Could possibly be
# tested in a better way...
@@ -33,8 +33,8 @@
call_counter = [0]
def fake_become_inevitable():
call_counter[0] += 1
- rstm.become_inevitable = fake_become_inevitable
+ monkeypatch.setattr(rstm, 'become_inevitable', fake_become_inevitable)
space = FakeSpace()
l = STMThreadLocals(space)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit