Example #1
0
def test_cpp_failure_repr(dummy_failure):
    dummy_failure.lines = [("error message", {"red"})]
    dummy_failure.file_reference = "test_suite", 20
    failure_repr = CppFailureRepr([dummy_failure])
    assert str(failure_repr) == "error message\ntest_suite:20: C++ failure"
Example #2
0
def test_cpp_failure_repr(dummy_failure):
    dummy_failure.lines = [('error message', {'red'})]
    dummy_failure.file_reference = 'test_suite', 20
    failure_repr = CppFailureRepr([dummy_failure])
    assert str(failure_repr) == 'error message\ntest_suite:20: C++ failure'
Example #3
0
 def repr_failure(self, excinfo):
     if isinstance(excinfo.value, CppFailureError):
         return CppFailureRepr(excinfo.value.failures)
     return pytest.Item.repr_failure(self, excinfo)