From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 18 Jun 2024 16:05:30 +0000 (+0200) Subject: [3.13] gh-117953: Skip `test_interpreters` properly without GIL (gh-120707) X-Git-Tag: v3.13.0b3~72 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=07145ddf19bc423e83d0290095833bc95861fc2f;p=thirdparty%2FPython%2Fcpython.git [3.13] gh-117953: Skip `test_interpreters` properly without GIL (gh-120707) (cherry picked from commit 1035fe0cfbeee23f61aed3332ebbae854e5da800, AKA gh-120689) Co-authored-by: Nice Zombies --- diff --git a/Lib/test/test_interpreters/__init__.py b/Lib/test/test_interpreters/__init__.py index 52ff553f60d0..e3d189c4efcd 100644 --- a/Lib/test/test_interpreters/__init__.py +++ b/Lib/test/test_interpreters/__init__.py @@ -1,6 +1,9 @@ import os from test.support import load_package_tests, Py_GIL_DISABLED +import unittest -if not Py_GIL_DISABLED: - def load_tests(*args): - return load_package_tests(os.path.dirname(__file__), *args) +if Py_GIL_DISABLED: + raise unittest.SkipTest("GIL disabled") + +def load_tests(*args): + return load_package_tests(os.path.dirname(__file__), *args)