コード例 #1
0
ファイル: test_exceptions.py プロジェクト: itkovian/reframe
 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)
コード例 #2
0
ファイル: test_exceptions.py プロジェクト: itkovian/reframe
 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)
コード例 #3
0
ファイル: test_exceptions.py プロジェクト: stevenvdb/reframe
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
コード例 #4
0
ファイル: test_exceptions.py プロジェクト: stevenvdb/reframe
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
コード例 #5
0
ファイル: test_exceptions.py プロジェクト: stevenvdb/reframe
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
コード例 #6
0
ファイル: test_exceptions.py プロジェクト: vkarak/reframe
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