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

Function test_file_processing_switch

numpy/f2py/tests/test_f2py2e.py:295–322  ·  view source on GitHub ↗

Tests that it is possible to return to file processing mode CLI :: : BUG: numpy-gh #20520

(capfd, hello_world_f90, retreal_f77,
                                monkeypatch)

Source from the content-addressed store, hash-verified

293
294
295def test_file_processing_switch(capfd, hello_world_f90, retreal_f77,
296 monkeypatch):
297 """Tests that it is possible to return to file processing mode
298 CLI :: :
299 BUG: numpy-gh #20520
300 """
301 foutl = get_io_paths(retreal_f77, mname="test")
302 ipath = foutl.finp
303 toskip = "t0 t4 t8 sd s8 s4"
304 ipath2 = Path(hello_world_f90)
305 tokeep = "td s0 hi" # hi is in ipath2
306 mname = "blah"
307 monkeypatch.setattr(
308 sys,
309 "argv",
310 f'f2py {ipath} -m {mname} only: {tokeep} : {ipath2}'.split(
311 ),
312 )
313
314 with util.switchdir(ipath.parent):
315 f2pycli()
316 out, err = capfd.readouterr()
317 for skey in toskip.split():
318 assert (
319 f'buildmodule: Could not find the body of interfaced routine "{skey}". Skipping.'
320 in err)
321 for rkey in tokeep.split():
322 assert f'Constructing wrapper function "{rkey}"' in out
323
324
325def test_mod_gen_f77(capfd, hello_world_f90, monkeypatch):

Callers

nothing calls this directly

Calls 2

get_io_pathsFunction · 0.85
splitMethod · 0.45

Tested by

no test coverage detected