https://github.com/python/cpython/commit/fb50266c4b67e03bd1b2a81ed5bb0eaf82b3e08f
commit: fb50266c4b67e03bd1b2a81ed5bb0eaf82b3e08f
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: corona10 <[email protected]>
date: 2024-09-06T11:02:05+09:00
summary:

[3.13] gh-123275: Add tests for `PYTHON_GIL=1` and `-Xgil=1` (gh-123754) 
(gh-123755)

gh-123275: Add tests for `PYTHON_GIL=1` and `-Xgil=1` (gh-123754)
(cherry picked from commit fe24b718d231317516f96f896e7c17a4166f25a7)

Co-authored-by: Peter Bierma <[email protected]>

files:
M Lib/test/test_cmd_line.py

diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py
index 9624d35d0c3948..dc420f33c233af 100644
--- a/Lib/test/test_cmd_line.py
+++ b/Lib/test/test_cmd_line.py
@@ -879,19 +879,29 @@ def test_pythondevmode_env(self):
         self.assertEqual(proc.stdout.rstrip(), 'True')
         self.assertEqual(proc.returncode, 0, proc)
 
-    @unittest.skipUnless(support.Py_GIL_DISABLED,
-                         "PYTHON_GIL and -X gil only supported in 
Py_GIL_DISABLED builds")
     def test_python_gil(self):
         cases = [
             # (env, opt, expected, msg)
-            (None, None, 'None', "no options set"),
-            ('0', None, '0', "PYTHON_GIL=0"),
             ('1', None, '1', "PYTHON_GIL=1"),
-            ('1', '0', '0', "-X gil=0 overrides PYTHON_GIL=1"),
-            (None, '0', '0', "-X gil=0"),
             (None, '1', '1', "-X gil=1"),
         ]
 
+        if support.Py_GIL_DISABLED:
+            cases.extend(
+                [
+                    (None, None, 'None', "no options set"),
+                    ('0', None, '0', "PYTHON_GIL=0"),
+                    ('1', '0', '0', "-X gil=0 overrides PYTHON_GIL=1"),
+                    (None, '0', '0', "-X gil=0"),
+                ]
+            )
+        else:
+            cases.extend(
+                [
+                    (None, None, '1', '-X gil=0 (unsupported by this build)'),
+                    ('1', None, '1', 'PYTHON_GIL=0 (unsupported by this 
build)'),
+                ]
+            )
         code = "import sys; print(sys.flags.gil)"
         environ = dict(os.environ)
 

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to