diff options
author | John Szakmeister <john@szakmeister.net> | 2013-01-18 03:00:28 -0800 |
---|---|---|
committer | John Szakmeister <john@szakmeister.net> | 2013-01-18 03:00:28 -0800 |
commit | d94b7428e55e637078921da590fcd1c77510ae46 (patch) | |
tree | 85f5863152ae77f1bcb1061a38434750c3c6e6eb /functional_tests | |
parent | b6843dff5c04ffbd27b888f3fea11a435e5ddb7b (diff) | |
parent | e9e63dcd2ea37ac8d3bd72c9d4a89e7a8a5e7b2e (diff) | |
download | nose-d94b7428e55e637078921da590fcd1c77510ae46.tar.gz |
Merge pull request #598 from mitya57/master
Fixed #513: exception in test generator leads to a TypeError.
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() |