Test that functions can be kept by only: CLI :: only:
(capfd, retreal_f77, monkeypatch)
| 292 | |
| 293 | |
| 294 | def test_f2py_only(capfd, retreal_f77, monkeypatch): |
| 295 | """Test that functions can be kept by only: |
| 296 | CLI :: only: |
| 297 | """ |
| 298 | foutl = get_io_paths(retreal_f77, mname="test") |
| 299 | ipath = foutl.finp |
| 300 | toskip = "t0 t4 t8 sd s8 s4" |
| 301 | tokeep = "td s0" |
| 302 | monkeypatch.setattr( |
| 303 | sys, "argv", |
| 304 | f'f2py {ipath} -m test only: {tokeep}'.split()) |
| 305 | |
| 306 | with util.switchdir(ipath.parent): |
| 307 | f2pycli() |
| 308 | out, err = capfd.readouterr() |
| 309 | for skey in toskip.split(): |
| 310 | assert ( |
| 311 | f'buildmodule: Could not find the body of interfaced routine "{skey}". Skipping.' |
| 312 | in err) |
| 313 | for rkey in tokeep.split(): |
| 314 | assert f'Constructing wrapper function "{rkey}"' in out |
| 315 | |
| 316 | |
| 317 | def test_file_processing_switch(capfd, hello_world_f90, retreal_f77, |
nothing calls this directly
no test coverage detected
searching dependent graphs…