def test_spawned_process_error_nostderr(self): exc_args = ('foo bar', 'partial output', '', 1) e = exc.SpawnedProcessError(*exc_args) self.assertRaisesRegex( exc.ReframeError, r"command 'foo bar' failed with exit code 1:\n" r"=== STDOUT ===\n" r'partial output\n' r"=== STDERR ===", raise_exc, e)
def test_spawned_process_error_nostdout(self): exc_args = ('foo bar', '', 'error message', 1) e = exc.SpawnedProcessError(*exc_args) self.assertRaisesRegex( exc.ReframeError, r"command 'foo bar' failed with exit code 1:\n" r"=== STDOUT ===\n" r"=== STDERR ===\n" r"error message", raise_exc, e)
def test_spawned_process_error_nostderr(): exc_args = ('foo bar', 'partial output', '', 1) e = exc.SpawnedProcessError(*exc_args) with pytest.raises(exc.ReframeError, match=(r"command 'foo bar' failed with exit code 1:\n" r"=== STDOUT ===\n" r'partial output\n' r"=== STDERR ===")): raise e
def test_spawned_process_error_nostdout(): exc_args = ('foo bar', '', 'error message', 1) e = exc.SpawnedProcessError(*exc_args) with pytest.raises(exc.ReframeError, match=(r"command 'foo bar' failed with exit code 1:\n" r"=== STDOUT ===\n" r"=== STDERR ===\n" r"error message")): raise e
def test_spawned_process_error_list_args(): exc_args = (['foo', 'bar'], 'partial output', 'error message', 1) e = exc.SpawnedProcessError(*exc_args) with pytest.raises(exc.ReframeError, match=(r"command 'foo bar' failed with exit code 1:\n" r"=== STDOUT ===\n" r'partial output\n' r"=== STDERR ===\n" r"error message")): raise e assert exc_args == e.args
def test_spawned_process_error(): exc_args = ('foo bar', 'partial output', 'error message', 1) e = exc.SpawnedProcessError(*exc_args) with pytest.raises(exc.ReframeError, match=(r"command 'foo bar' failed with exit code 1:\n" r"--- stdout ---\n" r'partial output\n' r"--- stdout ---\n" r"--- stderr ---\n" r"error message\n" r"--- stderr ---")): raise e assert exc_args == e.args