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

Function test_debugcapi_bld

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

602
603@pytest.mark.skip(reason="Consistently fails on CI; noisy so skip not xfail.")
604def test_debugcapi_bld(hello_world_f90, monkeypatch):
605 """Ensures that debugging wrappers work
606
607 CLI :: --debug-capi -c
608 """
609 ipath = Path(hello_world_f90)
610 mname = "blah"
611 monkeypatch.setattr(sys, "argv",
612 f'f2py -m {mname} {ipath} -c --debug-capi'.split())
613
614 with util.switchdir(ipath.parent):
615 f2pycli()
616 cmd_run = shlex.split(f"{sys.executable} -c \"import blah; blah.hi()\"")
617 rout = subprocess.run(cmd_run, capture_output=True, encoding='UTF-8')
618 eout = ' Hello World\n'
619 eerr = textwrap.dedent("""\
620debug-capi:Python C/API function blah.hi()
621debug-capi:float hi=:output,hidden,scalar
622debug-capi:hi=0
623debug-capi:Fortran subroutine `f2pywraphi(&hi)'
624debug-capi:hi=0
625debug-capi:Building return value.
626debug-capi:Python C/API function blah.hi: successful.
627debug-capi:Freeing memory.
628 """)
629 assert rout.stdout == eout
630 assert rout.stderr == eerr
631
632
633def test_wrapfunc_def(capfd, hello_world_f90, monkeypatch):

Callers

nothing calls this directly

Calls 2

splitMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…