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

Function test_f2py_init_compile_bad_cmd

numpy/f2py/tests/test_compile_function.py:86–101  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

84
85
86def test_f2py_init_compile_bad_cmd():
87 # verify that usage of invalid command in f2py.compile() returns
88 # status value of 127 for historic consistency with exec_command()
89 # error handling
90
91 # patch the sys Python exe path temporarily to induce an OSError
92 # downstream NOTE: how bad of an idea is this patching?
93 try:
94 temp = sys.executable
95 sys.executable = "does not exist"
96
97 # the OSError should take precedence over invalid Fortran
98 ret_val = numpy.f2py.compile(b"invalid")
99 assert ret_val == 127
100 finally:
101 sys.executable = temp
102
103
104@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 1

compileMethod · 0.45

Tested by

no test coverage detected