CLI :: --freethreading_compatible
(hello_world_f90, monkeypatch)
| 837 | @pytest.mark.skipif((platform.system() != 'Linux') or sys.version_info <= (3, 12), |
| 838 | reason='Compiler and Python 3.12 or newer required') |
| 839 | def test_freethreading_compatible(hello_world_f90, monkeypatch): |
| 840 | """ |
| 841 | CLI :: --freethreading_compatible |
| 842 | """ |
| 843 | ipath = Path(hello_world_f90) |
| 844 | monkeypatch.setattr(sys, "argv", f'f2py -m blah {ipath} -c --freethreading-compatible'.split()) |
| 845 | |
| 846 | with util.switchdir(ipath.parent): |
| 847 | compiler_check_f2pycli() |
| 848 | cmd = f"{sys.executable} -c \"import blah; blah.hi();" |
| 849 | if NOGIL_BUILD: |
| 850 | cmd += "import sys; assert sys._is_gil_enabled() is False\"" |
| 851 | else: |
| 852 | cmd += "\"" |
| 853 | cmd_run = shlex.split(cmd) |
| 854 | rout = subprocess.run(cmd_run, capture_output=True, encoding='UTF-8') |
| 855 | eout = ' Hello World\n' |
| 856 | assert rout.stdout == eout |
| 857 | if "LSAN_OPTIONS" not in os.environ: |
| 858 | assert rout.stderr == "" |
| 859 | assert rout.returncode == 0 |
| 860 | |
| 861 | |
| 862 | # Numpy distutils flags |
nothing calls this directly
no test coverage detected
searching dependent graphs…