MCPcopy Index your code
hub / github.com/numpy/numpy / test_lower_cmod

Function test_lower_cmod

numpy/f2py/tests/test_f2py2e.py:380–403  ·  view source on GitHub ↗

Lowers cases by flag or when -h is present CLI :: --[no-]lower

(capfd, hello_world_f77, monkeypatch)

Source from the content-addressed store, hash-verified

378
379
380def test_lower_cmod(capfd, hello_world_f77, monkeypatch):
381 """Lowers cases by flag or when -h is present
382
383 CLI :: --[no-]lower
384 """
385 foutl = get_io_paths(hello_world_f77, mname="test")
386 ipath = foutl.finp
387 capshi = re.compile(r"HI\(\)")
388 capslo = re.compile(r"hi\(\)")
389 # Case I: --lower is passed
390 monkeypatch.setattr(sys, "argv", f'f2py {ipath} -m test --lower'.split())
391 with util.switchdir(ipath.parent):
392 f2pycli()
393 out, _ = capfd.readouterr()
394 assert capslo.search(out) is not None
395 assert capshi.search(out) is None
396 # Case II: --no-lower is passed
397 monkeypatch.setattr(sys, "argv",
398 f'f2py {ipath} -m test --no-lower'.split())
399 with util.switchdir(ipath.parent):
400 f2pycli()
401 out, _ = capfd.readouterr()
402 assert capslo.search(out) is None
403 assert capshi.search(out) is not None
404
405
406def test_lower_sig(capfd, hello_world_f77, monkeypatch):

Callers

nothing calls this directly

Calls 3

get_io_pathsFunction · 0.85
splitMethod · 0.80
compileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…