From f483652905bdcb03ac8d86a2dc79afcfd83f2a1c Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Fri, 19 May 2023 00:11:48 +0200 Subject: [PATCH] gh-104629: Don't skip test_clinic if _testclinic is missing Just skip the tests that depend on the _testclinic extension module; we can still run the Python tests. --- Lib/test/test_clinic.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_clinic.py b/Lib/test/test_clinic.py index 28d9f650926427..f72cb0442f35ff 100644 --- a/Lib/test/test_clinic.py +++ b/Lib/test/test_clinic.py @@ -868,9 +868,12 @@ def test_external(self): 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_'))