Ensures that debugging wrappers work CLI :: --debug-capi -c
(hello_world_f90, monkeypatch)
| 562 | |
| 563 | @pytest.mark.xfail(reason="Consistently fails on CI.") |
| 564 | def 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("""\ |
| 580 | debug-capi:Python C/API function blah.hi() |
| 581 | debug-capi:float hi=:output,hidden,scalar |
| 582 | debug-capi:hi=0 |
| 583 | debug-capi:Fortran subroutine `f2pywraphi(&hi)' |
| 584 | debug-capi:hi=0 |
| 585 | debug-capi:Building return value. |
| 586 | debug-capi:Python C/API function blah.hi: successful. |
| 587 | debug-capi:Freeing memory. |
| 588 | """) |
| 589 | assert rout.stdout == eout |
| 590 | assert rout.stderr == eerr |
| 591 | |
| 592 | |
| 593 | def test_wrapfunc_def(capfd, hello_world_f90, monkeypatch): |