Issue #315 resolved

--tb=native ignored in tearDown() methods

Nikolaus Rath avatarNikolaus Rath created an issue

It seems that --tab=native is ignored in some circumstances:

$ cat pytest.ini 
[pytest]
addopts = --verbose --assert=plain --exitfirst --tb=native

$ cat test_error.py 
import unittest

class URLTests(unittest.TestCase):

    def test_s3(self):
        raise RuntimeError('Problem 1')

    def tearDown(self):
        raise RuntimeError('Problem 2')

def suite():
    return unittest.makeSuite(LocalTests)

if __name__ == "__main__":
    unittest.main()

$ py.test
================================================== test session starts ===================================================
platform linux -- Python 3.3.2 -- pytest-2.3.5 -- /usr/bin/python3.3
collected 1 items 

test_error.py:5: URLTests.test_s3 FAILED
test_error.py:5: URLTests.test_s3 ERROR

========================================================= ERRORS =========================================================
_________________________________________ ERROR at teardown of URLTests.test_s3 __________________________________________

self = <test_error.URLTests testMethod=test_s3>

    def tearDown(self):
>       raise RuntimeError('Problem 2')
E       RuntimeError: Problem 2

test_error.py:9: RuntimeError
======================================================== FAILURES ========================================================
____________________________________________________ URLTests.test_s3 ____________________________________________________
Traceback (most recent call last):
  File "/home/nikratio/tmp/f/test_error.py", line 6, in test_s3
    raise RuntimeError('Problem 1')
RuntimeError: Problem 1
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: stopping after 2 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=========================================== 1 failed, 1 error in 0.03 seconds ============================================

Comments (1)

  1. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.