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

Function test_debugcapi_bld

numpy/f2py/tests/test_f2py2e.py:564–590  ·  view source on GitHub ↗

Ensures that debugging wrappers work CLI :: --debug-capi -c

(hello_world_f90, monkeypatch)

Source from the content-addressed store, hash-verified

562
563@pytest.mark.xfail(reason="Consistently fails on CI.")
564def test_debugcapi_bld(hello_world_f90, monkeypatch):
565 """Ensures that debugging wrappers work
566
567 CLI :: --debug-capi -c
568 """
569 ipath = Path(hello_world_f90)
570 mname = "blah"
571 monkeypatch.setattr(sys, "argv",
572 f'f2py -m {mname} {ipath} -c --debug-capi'.split())
573
574 with util.switchdir(ipath.parent):
575 f2pycli()
576 cmd_run = shlex.split("python3 -c \"import blah; blah.hi()\"")
577 rout = subprocess.run(cmd_run, capture_output=True, encoding='UTF-8')
578 eout = ' Hello World\n'
579 eerr = textwrap.dedent("""\
580debug-capi:Python C/API function blah.hi()
581debug-capi:float hi=:output,hidden,scalar
582debug-capi:hi=0
583debug-capi:Fortran subroutine `f2pywraphi(&hi)'
584debug-capi:hi=0
585debug-capi:Building return value.
586debug-capi:Python C/API function blah.hi: successful.
587debug-capi:Freeing memory.
588 """)
589 assert rout.stdout == eout
590 assert rout.stderr == eerr
591
592
593def test_wrapfunc_def(capfd, hello_world_f90, monkeypatch):

Callers

nothing calls this directly

Calls 2

splitMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected