diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-02-07 10:10:55 +0200 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-02-07 10:10:55 +0200 |
commit | f28ba369dd068a76ff5b7efac58fdcb5c3eaf4dd (patch) | |
tree | 541cb209a2be79d6022ce5d47216755e9e9310a4 /Lib/test/test_finalization.py | |
parent | 622be340fdf4110c77e1f86bd13a01fc30c2bb65 (diff) | |
parent | 5cfc79deaeabf4af3c767665098a37da9f375eda (diff) | |
download | cpython-git-f28ba369dd068a76ff5b7efac58fdcb5c3eaf4dd.tar.gz |
Issue #20532: Tests which use _testcapi now are marked as CPython only.
Diffstat (limited to 'Lib/test/test_finalization.py')
-rw-r--r-- | Lib/test/test_finalization.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/Lib/test/test_finalization.py b/Lib/test/test_finalization.py index 80c9b87988..03ac1aa274 100644 --- a/Lib/test/test_finalization.py +++ b/Lib/test/test_finalization.py @@ -7,7 +7,15 @@ import gc import unittest import weakref -import _testcapi +try: + from _testcapi import with_tp_del +except ImportError: + def with_tp_del(cls): + class C(object): + def __new__(cls, *args, **kwargs): + raise TypeError('requires _testcapi.with_tp_del') + return C + from test import support @@ -423,11 +431,11 @@ class LegacyBase(SimpleBase): except Exception as e: self.errors.append(e) -@_testcapi.with_tp_del +@with_tp_del class Legacy(LegacyBase): pass -@_testcapi.with_tp_del +@with_tp_del class LegacyResurrector(LegacyBase): def side_effect(self): @@ -436,11 +444,12 @@ class LegacyResurrector(LegacyBase): """ self.survivors.append(self) -@_testcapi.with_tp_del +@with_tp_del class LegacySelfCycle(SelfCycleBase, LegacyBase): pass +@support.cpython_only class LegacyFinalizationTest(TestBase, unittest.TestCase): """ Test finalization of objects with a tp_del. |