MCPcopy Create free account
hub / github.com/numpy/numpy / test_f2py_only

Function test_f2py_only

numpy/f2py/tests/test_f2py2e.py:272–292  ·  view source on GitHub ↗

Test that functions can be kept by only: CLI :: only:

(capfd, retreal_f77, monkeypatch)

Source from the content-addressed store, hash-verified

270
271
272def test_f2py_only(capfd, retreal_f77, monkeypatch):
273 """Test that functions can be kept by only:
274 CLI :: only:
275 """
276 foutl = get_io_paths(retreal_f77, mname="test")
277 ipath = foutl.finp
278 toskip = "t0 t4 t8 sd s8 s4"
279 tokeep = "td s0"
280 monkeypatch.setattr(
281 sys, "argv",
282 f'f2py {ipath} -m test only: {tokeep}'.split())
283
284 with util.switchdir(ipath.parent):
285 f2pycli()
286 out, err = capfd.readouterr()
287 for skey in toskip.split():
288 assert (
289 f'buildmodule: Could not find the body of interfaced routine "{skey}". Skipping.'
290 in err)
291 for rkey in tokeep.split():
292 assert f'Constructing wrapper function "{rkey}"' in out
293
294
295def test_file_processing_switch(capfd, hello_world_f90, retreal_f77,

Callers

nothing calls this directly

Calls 2

get_io_pathsFunction · 0.85
splitMethod · 0.45

Tested by

no test coverage detected