MCPcopy Create free account
hub / github.com/numpy/numpy / test_lower_cmod

Function test_lower_cmod

numpy/f2py/tests/test_f2py2e.py:358–381  ·  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

356
357
358def test_lower_cmod(capfd, hello_world_f77, monkeypatch):
359 """Lowers cases by flag or when -h is present
360
361 CLI :: --[no-]lower
362 """
363 foutl = get_io_paths(hello_world_f77, mname="test")
364 ipath = foutl.finp
365 capshi = re.compile(r"HI\(\)")
366 capslo = re.compile(r"hi\(\)")
367 # Case I: --lower is passed
368 monkeypatch.setattr(sys, "argv", f'f2py {ipath} -m test --lower'.split())
369 with util.switchdir(ipath.parent):
370 f2pycli()
371 out, _ = capfd.readouterr()
372 assert capslo.search(out) is not None
373 assert capshi.search(out) is None
374 # Case II: --no-lower is passed
375 monkeypatch.setattr(sys, "argv",
376 f'f2py {ipath} -m test --no-lower'.split())
377 with util.switchdir(ipath.parent):
378 f2pycli()
379 out, _ = capfd.readouterr()
380 assert capslo.search(out) is None
381 assert capshi.search(out) is not None
382
383
384def test_lower_sig(capfd, hello_world_f77, monkeypatch):

Callers

nothing calls this directly

Calls 3

get_io_pathsFunction · 0.85
compileMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected