Skip to content

Commit 5bf4414

Browse files
committed
Add a test that we're not enabling the GIL.
1 parent 0778d50 commit 5bf4414

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ jobs:
107107
run: |
108108
sphinx-build -b doctest -d docs/_build/doctrees2 docs docs/_build/doctest2
109109
- name: Lint
110-
if: matrix.python-version == '3.12' && startsWith(runner.os, 'Linux')
110+
if: matrix.python-version == '3.14' && startsWith(runner.os, 'Linux')
111111
# We only need to do this on one version.
112112
# We do this here rather than a separate job to avoid the compilation overhead.
113113
run: |

src/greenlet/tests/test_greenlet.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,5 +1349,16 @@ def test_reentrant_switch_run_callable_has_del(self):
13491349
output
13501350
)
13511351

1352+
class TestModule(TestCase):
1353+
1354+
@unittest.skipUnless(hasattr(sys, '_is_gil_enabled'),
1355+
"Needs 3.13 and above for sys._is_gil_enabled")
1356+
def test_no_gil_on_free_threaded(self):
1357+
1358+
if RUNNING_ON_FREETHREAD_BUILD:
1359+
self.assertFalse(sys._is_gil_enabled())
1360+
else:
1361+
self.assertTrue(sys._is_gil_enabled())
1362+
13521363
if __name__ == '__main__':
13531364
unittest.main()

0 commit comments

Comments
 (0)