summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_genericclass.py
diff options
context:
space:
mode:
authorErlend E. Aasland <erlend@python.org>2024-04-03 13:11:36 (GMT)
committerGitHub <noreply@github.com>2024-04-03 13:11:36 (GMT)
commitea94b3b149eeadf33c2f7c46f16dcda0adc7cf4e (patch)
tree7fc58f8dcd7513427c7ea2ff9d7bad523be1118a /Lib/test/test_genericclass.py
parent2ec6bb4111d2c03c1cac02b27c74beee7e5a2a05 (diff)
downloadcpython-ea94b3b149eeadf33c2f7c46f16dcda0adc7cf4e.zip
cpython-ea94b3b149eeadf33c2f7c46f16dcda0adc7cf4e.tar.gz
cpython-ea94b3b149eeadf33c2f7c46f16dcda0adc7cf4e.tar.bz2
gh-116303: Skip test module dependent tests if test modules are unavailable (#117341)
Diffstat (limited to 'Lib/test/test_genericclass.py')
-rw-r--r--Lib/test/test_genericclass.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_genericclass.py b/Lib/test/test_genericclass.py
index aece757..e530b46 100644
--- a/Lib/test/test_genericclass.py
+++ b/Lib/test/test_genericclass.py
@@ -1,5 +1,6 @@
import unittest
from test import support
+from test.support.import_helper import import_module
class TestMROEntry(unittest.TestCase):
@@ -277,7 +278,9 @@ class TestClassGetitem(unittest.TestCase):
class CAPITest(unittest.TestCase):
def test_c_class(self):
- from _testcapi import Generic, GenericAlias
+ _testcapi = import_module("_testcapi")
+ Generic = _testcapi.Generic
+ GenericAlias = _testcapi.GenericAlias
self.assertIsInstance(Generic.__class_getitem__(int), GenericAlias)
IntGeneric = Generic[int]