Lowers cases in signature files by flag or when -h is present CLI :: --[no-]lower -h
(capfd, hello_world_f77, monkeypatch)
| 404 | |
| 405 | |
| 406 | def test_lower_sig(capfd, hello_world_f77, monkeypatch): |
| 407 | """Lowers cases in signature files by flag or when -h is present |
| 408 | |
| 409 | CLI :: --[no-]lower -h |
| 410 | """ |
| 411 | foutl = get_io_paths(hello_world_f77, mname="test") |
| 412 | ipath = foutl.finp |
| 413 | # Signature files |
| 414 | capshi = re.compile(r"Block: HI") |
| 415 | capslo = re.compile(r"Block: hi") |
| 416 | # Case I: --lower is implied by -h |
| 417 | # TODO: Clean up to prevent passing --overwrite-signature |
| 418 | monkeypatch.setattr( |
| 419 | sys, |
| 420 | "argv", |
| 421 | f'f2py {ipath} -h {foutl.pyf} -m test --overwrite-signature'.split(), |
| 422 | ) |
| 423 | |
| 424 | with util.switchdir(ipath.parent): |
| 425 | f2pycli() |
| 426 | out, _ = capfd.readouterr() |
| 427 | assert capslo.search(out) is not None |
| 428 | assert capshi.search(out) is None |
| 429 | |
| 430 | # Case II: --no-lower overrides -h |
| 431 | monkeypatch.setattr( |
| 432 | sys, |
| 433 | "argv", |
| 434 | f'f2py {ipath} -h {foutl.pyf} -m test --overwrite-signature --no-lower' |
| 435 | .split(), |
| 436 | ) |
| 437 | |
| 438 | with util.switchdir(ipath.parent): |
| 439 | f2pycli() |
| 440 | out, _ = capfd.readouterr() |
| 441 | assert capslo.search(out) is None |
| 442 | assert capshi.search(out) is not None |
| 443 | |
| 444 | |
| 445 | def test_build_dir(capfd, hello_world_f90, monkeypatch): |
nothing calls this directly
no test coverage detected
searching dependent graphs…