CLI :: --no-freethreading-compatible
(hello_world_f90, monkeypatch)
| 812 | reason='Compiler and Python 3.12 or newer required') |
| 813 | @pytest.mark.slow |
| 814 | def 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), |
nothing calls this directly
no test coverage detected
searching dependent graphs…