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

Function test_no_distutils_backend

numpy/f2py/tests/test_f2py2e.py:238–268  ·  view source on GitHub ↗

Check that distutils backend and related options fail CLI :: --fcompiler --help-link --backend distutils

(capfd, hello_world_f90, monkeypatch)

Source from the content-addressed store, hash-verified

236
237@pytest.mark.slow
238def test_no_distutils_backend(capfd, hello_world_f90, monkeypatch):
239 """Check that distutils backend and related options fail
240 CLI :: --fcompiler --help-link --backend distutils
241 """
242 MNAME = "hi"
243 foutl = get_io_paths(hello_world_f90, mname=MNAME)
244 ipath = foutl.f90inp
245 monkeypatch.setattr(
246 sys, "argv", f"f2py {ipath} -c --fcompiler=gfortran -m {MNAME}".split()
247 )
248 with util.switchdir(ipath.parent):
249 compiler_check_f2pycli()
250 out, _ = capfd.readouterr()
251 assert "--fcompiler cannot be used with meson" in out
252
253 monkeypatch.setattr(
254 sys, "argv", ["f2py", "--help-link"]
255 )
256 with pytest.raises(SystemExit):
257 f2pycli()
258 out, _ = capfd.readouterr()
259 assert "Unknown option --help-link" in out
260
261 monkeypatch.setattr(
262 sys, "argv", ["f2py", "--backend", "distutils"]
263 )
264 with pytest.raises(SystemExit):
265 compiler_check_f2pycli()
266 f2pycli()
267 out, _ = capfd.readouterr()
268 assert "'distutils' backend was removed" in out
269
270@pytest.mark.xfail
271def test_f2py_skip(capfd, retreal_f77, monkeypatch):

Callers

nothing calls this directly

Calls 3

get_io_pathsFunction · 0.85
compiler_check_f2pycliFunction · 0.85
splitMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…