forked from pyparsing/pyparsing
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
16 lines (12 loc) · 708 Bytes
/
Copy pathconftest.py
File metadata and controls
16 lines (12 loc) · 708 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import sys
def pytest_report_header(config, start_path):
# 1. Fetch the JIT state safely (using .is_enabled() for global status)
jit_supported = getattr(sys, "_jit", None) is not None
jit_status = "Enabled" if (jit_supported and sys._jit.is_enabled()) else "Disabled"
if not jit_supported:
jit_status = "Not Supported by Python Binary"
# 2. Fetch the GIL status (Free-threaded Python 3.13+)
gil_active = getattr(sys, "_is_gil_enabled", lambda: True)()
gil_status = "Active (Standard)" if gil_active else "Disabled (Free-Threaded)"
# Return lines to inject directly beneath rootdir/cachedir
return [f"JIT compiler: {jit_status}", f"GIL status: {gil_status}"]