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

Function test_file_processing_switch

numpy/f2py/tests/test_f2py2e.py:317–344  ·  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

315
316
317def test_file_processing_switch(capfd, hello_world_f90, retreal_f77,
318 monkeypatch):
319 """Tests that it is possible to return to file processing mode
320 CLI :: :
321 BUG: numpy-gh #20520
322 """
323 foutl = get_io_paths(retreal_f77, mname="test")
324 ipath = foutl.finp
325 toskip = "t0 t4 t8 sd s8 s4"
326 ipath2 = Path(hello_world_f90)
327 tokeep = "td s0 hi" # hi is in ipath2
328 mname = "blah"
329 monkeypatch.setattr(
330 sys,
331 "argv",
332 f'f2py {ipath} -m {mname} only: {tokeep} : {ipath2}'.split(
333 ),
334 )
335
336 with util.switchdir(ipath.parent):
337 f2pycli()
338 out, err = capfd.readouterr()
339 for skey in toskip.split():
340 assert (
341 f'buildmodule: Could not find the body of interfaced routine "{skey}". Skipping.'
342 in err)
343 for rkey in tokeep.split():
344 assert f'Constructing wrapper function "{rkey}"' in out
345
346
347def test_mod_gen_f77(capfd, hello_world_f90, monkeypatch):

Callers

nothing calls this directly

Calls 2

get_io_pathsFunction · 0.85
splitMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…