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

Class emulate_nonposix

numpy/distutils/tests/test_exec_command.py:45–55  ·  view source on GitHub ↗

Context manager to emulate os.name != 'posix'

Source from the content-addressed store, hash-verified

43 self._stderr.close()
44
45class emulate_nonposix:
46 """Context manager to emulate os.name != 'posix' """
47 def __init__(self, osname='non-posix'):
48 self._new_name = osname
49
50 def __enter__(self):
51 self._old_name = os.name
52 os.name = self._new_name
53
54 def __exit__(self, exc_type, exc_value, traceback):
55 os.name = self._old_name
56
57
58def test_exec_command_stdout():

Callers 2

test_exec_command_stdoutFunction · 0.85
test_exec_command_stderrFunction · 0.85

Calls

no outgoing calls

Tested by 2

test_exec_command_stdoutFunction · 0.68
test_exec_command_stderrFunction · 0.68