Skip to content

Commit

Permalink
Report Py_GIL_DISABLED config in pytest output
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Sep 27, 2024
1 parent 9891736 commit cefaed9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import sysconfig
import typing as t
from types import ModuleType

Expand All @@ -14,6 +15,11 @@
_speedups = None # type: ignore


def pytest_report_header() -> list[str]:
"""Return a list of strings to be displayed in the header of the report."""
return [f"Free-threaded: {bool(sysconfig.get_config_var('Py_GIL_DISABLED'))}"]


@pytest.fixture(
scope="session",
autouse=True,
Expand Down

0 comments on commit cefaed9

Please sign in to comment.