Test that functions can be kept by only: CLI :: only:
(capfd, retreal_f77, monkeypatch)
| 270 | |
| 271 | |
| 272 | def test_f2py_only(capfd, retreal_f77, monkeypatch): |
| 273 | """Test that functions can be kept by only: |
| 274 | CLI :: only: |
| 275 | """ |
| 276 | foutl = get_io_paths(retreal_f77, mname="test") |
| 277 | ipath = foutl.finp |
| 278 | toskip = "t0 t4 t8 sd s8 s4" |
| 279 | tokeep = "td s0" |
| 280 | monkeypatch.setattr( |
| 281 | sys, "argv", |
| 282 | f'f2py {ipath} -m test only: {tokeep}'.split()) |
| 283 | |
| 284 | with util.switchdir(ipath.parent): |
| 285 | f2pycli() |
| 286 | out, err = capfd.readouterr() |
| 287 | for skey in toskip.split(): |
| 288 | assert ( |
| 289 | f'buildmodule: Could not find the body of interfaced routine "{skey}". Skipping.' |
| 290 | in err) |
| 291 | for rkey in tokeep.split(): |
| 292 | assert f'Constructing wrapper function "{rkey}"' in out |
| 293 | |
| 294 | |
| 295 | def test_file_processing_switch(capfd, hello_world_f90, retreal_f77, |
nothing calls this directly
no test coverage detected