Ensures that debugging wrappers work CLI :: --debug-capi -c
(hello_world_f90, monkeypatch)
| 602 | |
| 603 | @pytest.mark.skip(reason="Consistently fails on CI; noisy so skip not xfail.") |
| 604 | def 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("""\ |
| 620 | debug-capi:Python C/API function blah.hi() |
| 621 | debug-capi:float hi=:output,hidden,scalar |
| 622 | debug-capi:hi=0 |
| 623 | debug-capi:Fortran subroutine `f2pywraphi(&hi)' |
| 624 | debug-capi:hi=0 |
| 625 | debug-capi:Building return value. |
| 626 | debug-capi:Python C/API function blah.hi: successful. |
| 627 | debug-capi:Freeing memory. |
| 628 | """) |
| 629 | assert rout.stdout == eout |
| 630 | assert rout.stderr == eerr |
| 631 | |
| 632 | |
| 633 | def test_wrapfunc_def(capfd, hello_world_f90, monkeypatch): |