Lowers cases in signature files by flag or when -h is present CLI :: --[no-]lower -h
(capfd, hello_world_f77, monkeypatch)
| 382 | |
| 383 | |
| 384 | def test_lower_sig(capfd, hello_world_f77, monkeypatch): |
| 385 | """Lowers cases in signature files by flag or when -h is present |
| 386 | |
| 387 | CLI :: --[no-]lower -h |
| 388 | """ |
| 389 | foutl = get_io_paths(hello_world_f77, mname="test") |
| 390 | ipath = foutl.finp |
| 391 | # Signature files |
| 392 | capshi = re.compile(r"Block: HI") |
| 393 | capslo = re.compile(r"Block: hi") |
| 394 | # Case I: --lower is implied by -h |
| 395 | # TODO: Clean up to prevent passing --overwrite-signature |
| 396 | monkeypatch.setattr( |
| 397 | sys, |
| 398 | "argv", |
| 399 | f'f2py {ipath} -h {foutl.pyf} -m test --overwrite-signature'.split(), |
| 400 | ) |
| 401 | |
| 402 | with util.switchdir(ipath.parent): |
| 403 | f2pycli() |
| 404 | out, _ = capfd.readouterr() |
| 405 | assert capslo.search(out) is not None |
| 406 | assert capshi.search(out) is None |
| 407 | |
| 408 | # Case II: --no-lower overrides -h |
| 409 | monkeypatch.setattr( |
| 410 | sys, |
| 411 | "argv", |
| 412 | f'f2py {ipath} -h {foutl.pyf} -m test --overwrite-signature --no-lower' |
| 413 | .split(), |
| 414 | ) |
| 415 | |
| 416 | with util.switchdir(ipath.parent): |
| 417 | f2pycli() |
| 418 | out, _ = capfd.readouterr() |
| 419 | assert capslo.search(out) is None |
| 420 | assert capshi.search(out) is not None |
| 421 | |
| 422 | |
| 423 | def test_build_dir(capfd, hello_world_f90, monkeypatch): |
nothing calls this directly
no test coverage detected