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

Function test_mod_gen_gh25263

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

340
341
342def test_mod_gen_gh25263(capfd, hello_world_f77, monkeypatch):
343 """Check that pyf files are correctly generated with module structure
344 CLI :: -m <name> -h pyf_file
345 BUG: numpy-gh #20520
346 """
347 MNAME = "hi"
348 foutl = get_io_paths(hello_world_f77, mname=MNAME)
349 ipath = foutl.finp
350 monkeypatch.setattr(sys, "argv", f'f2py {ipath} -m {MNAME} -h hi.pyf'.split())
351 with util.switchdir(ipath.parent):
352 f2pycli()
353 with Path('hi.pyf').open() as hipyf:
354 pyfdat = hipyf.read()
355 assert "python module hi" in pyfdat
356
357
358def test_lower_cmod(capfd, hello_world_f77, monkeypatch):

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected