Context manager to emulate os.name != 'posix'
| 43 | self._stderr.close() |
| 44 | |
| 45 | class 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 | |
| 58 | def test_exec_command_stdout(): |
no outgoing calls