MCPcopy Index your code
hub / github.com/numpy/numpy / test_no_freethreading_compatible

Function test_no_freethreading_compatible

numpy/f2py/tests/test_f2py2e.py:814–834  ·  view source on GitHub ↗

CLI :: --no-freethreading-compatible

(hello_world_f90, monkeypatch)

Source from the content-addressed store, hash-verified

812 reason='Compiler and Python 3.12 or newer required')
813@pytest.mark.slow
814def test_no_freethreading_compatible(hello_world_f90, monkeypatch):
815 """
816 CLI :: --no-freethreading-compatible
817 """
818 ipath = Path(hello_world_f90)
819 monkeypatch.setattr(sys, "argv", f'f2py -m blah {ipath} -c --no-freethreading-compatible'.split())
820
821 with util.switchdir(ipath.parent):
822 compiler_check_f2pycli()
823 cmd = f"{sys.executable} -c \"import blah; blah.hi();"
824 if NOGIL_BUILD:
825 cmd += "import sys; assert sys._is_gil_enabled() is True\""
826 else:
827 cmd += "\""
828 cmd_run = shlex.split(cmd)
829 rout = subprocess.run(cmd_run, capture_output=True, encoding='UTF-8')
830 eout = ' Hello World\n'
831 assert rout.stdout == eout
832 if NOGIL_BUILD:
833 assert "The global interpreter lock (GIL) has been enabled to load module 'blah'" in rout.stderr
834 assert rout.returncode == 0
835
836
837@pytest.mark.skipif((platform.system() != 'Linux') or sys.version_info <= (3, 12),

Callers

nothing calls this directly

Calls 3

compiler_check_f2pycliFunction · 0.85
splitMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…