Skip to content

Commit d440dc3

Browse files
committed
Add behavioral test checking if GIL is disabled
1 parent 311226a commit d440dc3

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/validation.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2087,6 +2087,7 @@ fn verify_distribution_behavior(dist_path: &Path) -> Result<Vec<String>> {
20872087
.stdout_to_stderr()
20882088
.unchecked()
20892089
.env("TARGET_TRIPLE", &python_json.target_triple)
2090+
.env("BUILD_OPTIONS", &python_json.build_options)
20902091
.run()?;
20912092

20922093
if !output.status.success() {

src/verify_distribution.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,20 @@ def test_ssl(self):
141141

142142
ssl.create_default_context()
143143

144+
@unittest.skipIf(
145+
sys.version_info[:2] < (3, 13),
146+
"Free-threaded builds are only available in 3.13+",
147+
)
148+
def test_gil_disabled(self):
149+
import sysconfig
150+
151+
if "freethreaded" in os.environ.get("BUILD_OPTIONS", "").split("+"):
152+
wanted = 1
153+
else:
154+
wanted = 0
155+
156+
self.assertEqual(sysconfig.get_config_var("Py_GIL_DISABLED"), wanted)
157+
144158
@unittest.skipIf("TCL_LIBRARY" not in os.environ, "TCL_LIBRARY not set")
145159
@unittest.skipIf("DISPLAY" not in os.environ, "DISPLAY not set")
146160
def test_tkinter(self):

0 commit comments

Comments
 (0)