summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErlend E. Aasland <erlend.aasland@protonmail.com>2023-05-18 22:56:34 (GMT)
committerGitHub <noreply@github.com>2023-05-18 22:56:34 (GMT)
commit86ee49f469b84e4b746526a00d8191d0e374a268 (patch)
tree9d51ec4e58e848e2a18f0b6b0bc4ba4767083584
parentb9dce3aec46bf5190400bd8239fdd4ea9e64d674 (diff)
downloadcpython-86ee49f469b84e4b746526a00d8191d0e374a268.zip
cpython-86ee49f469b84e4b746526a00d8191d0e374a268.tar.gz
cpython-86ee49f469b84e4b746526a00d8191d0e374a268.tar.bz2
gh-104629: Don't skip test_clinic if _testclinic is missing (#104630)
Just skip the tests that depend on the _testclinic extension module; we can still run the Python tests.
-rw-r--r--Lib/test/test_clinic.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/test_clinic.py b/Lib/test/test_clinic.py
index 28d9f65..f72cb04 100644
--- a/Lib/test/test_clinic.py
+++ b/Lib/test/test_clinic.py
@@ -868,9 +868,12 @@ class ClinicExternalTest(TestCase):
self.assertEqual(new_mtime_ns, old_mtime_ns)
-ac_tester = import_helper.import_module('_testclinic')
-
+try:
+ import _testclinic as ac_tester
+except ImportError:
+ ac_tester = None
+@unittest.skipIf(ac_tester is None, "_testclinic is missing")
class ClinicFunctionalTest(unittest.TestCase):
locals().update((name, getattr(ac_tester, name))
for name in dir(ac_tester) if name.startswith('test_'))