summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Watson <cjwatson@canonical.com>2022-04-28 11:27:43 +0100
committerGitHub <noreply@github.com>2022-04-28 11:27:43 +0100
commit4a30fe9c8f81ab6d1133055b3c1830e4d86c8518 (patch)
tree2f1b6642ba2ecc5717d16ab69a16a8f9c0d9a51f
parent9dfd65aad70990c1e08b3ac3f060f9da2073daee (diff)
parent2adba3989fc3d1723eb6534ae0bc1aeaf1513cfa (diff)
downloadfixtures-git-4a30fe9c8f81ab6d1133055b3c1830e4d86c8518.tar.gz
Merge pull request #65 from mgorny/pypy3
Revert to the previous classmethod expectations for PyPy3.9
-rw-r--r--fixtures/tests/_fixtures/test_monkeypatch.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/fixtures/tests/_fixtures/test_monkeypatch.py b/fixtures/tests/_fixtures/test_monkeypatch.py
index 746f6dd..08cd1c8 100644
--- a/fixtures/tests/_fixtures/test_monkeypatch.py
+++ b/fixtures/tests/_fixtures/test_monkeypatch.py
@@ -23,6 +23,9 @@ from fixtures import MonkeyPatch, TestWithFixtures
reference = 23
+NEW_PY39_CLASSMETHOD = (
+ sys.version_info >= (3, 9) and not hasattr(sys, "pypy_version_info"))
+
class C(object):
def foo(self, arg):
return arg
@@ -196,7 +199,7 @@ class TestMonkeyPatch(testtools.TestCase, TestWithFixtures):
# with the class
#
# https://bugs.python.org/issue19072
- if sys.version_info >= (3, 9):
+ if NEW_PY39_CLASSMETHOD:
cls, = C.foo_cls()
self.expectThat(cls, Is(D))
cls, = C().foo_cls()
@@ -238,13 +241,13 @@ class TestMonkeyPatch(testtools.TestCase, TestWithFixtures):
self.expectThat(slf, Is(d))
# See note in test_patch_classmethod_with_classmethod on changes in
# Python 3.9
- if sys.version_info >= (3, 9):
+ if NEW_PY39_CLASSMETHOD:
self.expectThat(cls, Is(None))
else:
self.expectThat(cls, Is(C))
slf, cls = C().foo_cls()
self.expectThat(slf, Is(d))
- if sys.version_info >= (3, 9):
+ if NEW_PY39_CLASSMETHOD:
self.expectThat(cls, Is(None))
else:
self.expectThat(cls, Is(C))