Yelp / Testify

A more pythonic testing framework.
Other
306 stars 67 forks source link

When stripping testify frames, make sure to include all non-testify frames. #223

Closed bukzor closed 10 years ago

bukzor commented 10 years ago

Closes #177

Test failure for new test without my patch indicates the old formatter would just produce one frame of output.

$ testify test.test_result_test TestResultTestCase.test_frame_stripping -vv                                                     
test.test_result_test TestResultTestCase.test_frame_stripping ... fail: test.test_result_test TestResultTestCase.test_frame_stripping
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/mock.py", line 1190, in patched
    return func(*args, **keywargs)
  File "./test/test_result_test.py", line 51, in test_frame_stripping
    mock_format_exception.assert_called_with(AssertionError, 'wat', tb.tb_next.tb_next, 3)
  File "/usr/lib/pymodules/python2.6/mock.py", line 824, in assert_called_with
    raise AssertionError(msg)
AssertionError: Expected call: format_exception(<type 'exceptions.AssertionError'>, 'wat', <Mock name='mock.tb_next.tb_next.tb_next' id='38129104'>, 3
)
Actual call: format_exception(<type 'exceptions.AssertionError'>, 'wat', <Mock name='mock.tb_next.tb_next.tb_next' id='38129104'>, 1)

FAIL in 0.00s

FAILED.  1 tests / 1 cases: 0 passed, 1 failed.  (Total test time 0.00s)
eevee commented 10 years ago

:+1: