From 07145ddf19bc423e83d0290095833bc95861fc2f Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Tue, 18 Jun 2024 18:05:30 +0200 Subject: [PATCH] [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 --- Lib/test/test_interpreters/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Lib/test/test_interpreters/__init__.py b/Lib/test/test_interpreters/__init__.py index 52ff553f60d..e3d189c4efc 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)