diff options
Diffstat (limited to 'functional_tests')
-rw-r--r-- | functional_tests/support/issue513/test.py | 3 | ||||
-rw-r--r-- | functional_tests/test_failure.py | 29 |
2 files changed, 32 insertions, 0 deletions
diff --git a/functional_tests/support/issue513/test.py b/functional_tests/support/issue513/test.py new file mode 100644 index 0000000..a0c6238 --- /dev/null +++ b/functional_tests/support/issue513/test.py @@ -0,0 +1,3 @@ +def test(): + raise '\xf1'.encode('ASCII') + yield diff --git a/functional_tests/test_failure.py b/functional_tests/test_failure.py new file mode 100644 index 0000000..e9d17e9 --- /dev/null +++ b/functional_tests/test_failure.py @@ -0,0 +1,29 @@ +import os +import unittest + +from nose.plugins import PluginTester + +support = os.path.join(os.path.dirname(__file__), 'support', 'issue513') + +class TestPrintedTraceback(PluginTester, unittest.TestCase): + args = ['--where='+support] + activate = "-v" + + def makeSuite(self): + # make PluginTester happy, because we don't specify suitepath, we + # have to implement this function + return None + + def test_correct_exception_raised(self): + print + print '!' * 70 + print str(self.output) + print '!' * 70 + print + + # Look for the line in the traceback causing the failure + assert "raise '\\xf1'.encode('ASCII')" in str(self.output) + assert 'FAILED (errors=1)' in str(self.output) + +if __name__ == '__main__': + unittest.main() |