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

Function test_mod_gen_gh25263

numpy/f2py/tests/test_f2py2e.py:364–377  ·  view source on GitHub ↗

Check that pyf files are correctly generated with module structure CLI :: -m -h pyf_file BUG: numpy-gh #20520

(capfd, hello_world_f77, monkeypatch)

Source from the content-addressed store, hash-verified

362
363
364def test_mod_gen_gh25263(capfd, hello_world_f77, monkeypatch):
365 """Check that pyf files are correctly generated with module structure
366 CLI :: -m <name> -h pyf_file
367 BUG: numpy-gh #20520
368 """
369 MNAME = "hi"
370 foutl = get_io_paths(hello_world_f77, mname=MNAME)
371 ipath = foutl.finp
372 monkeypatch.setattr(sys, "argv", f'f2py {ipath} -m {MNAME} -h hi.pyf'.split())
373 with util.switchdir(ipath.parent):
374 f2pycli()
375 with Path('hi.pyf').open() as hipyf:
376 pyfdat = hipyf.read()
377 assert "python module hi" in pyfdat
378
379
380def test_lower_cmod(capfd, hello_world_f77, monkeypatch):

Callers

nothing calls this directly

Calls 4

get_io_pathsFunction · 0.85
splitMethod · 0.80
openMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…