diff options
author | John Szakmeister <john@szakmeister.net> | 2012-12-21 06:37:04 -0500 |
---|---|---|
committer | John Szakmeister <john@szakmeister.net> | 2012-12-21 06:38:51 -0500 |
commit | a99c1588e7799c63912c892b173994848331eab3 (patch) | |
tree | 8429a7cb0a2d0558300257486323fcecb73ad52a /functional_tests/test_xunit.py | |
parent | 9750803706c00eb4192a157909be5c964aa924f0 (diff) | |
download | nose-a99c1588e7799c63912c892b173994848331eab3.tar.gz |
Add a test for #134: Stop xunit from completely dying if it encounters an error
Diffstat (limited to 'functional_tests/test_xunit.py')
-rw-r--r-- | functional_tests/test_xunit.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/functional_tests/test_xunit.py b/functional_tests/test_xunit.py index 5d21a17..d137513 100644 --- a/functional_tests/test_xunit.py +++ b/functional_tests/test_xunit.py @@ -3,6 +3,7 @@ import codecs import os import sys import unittest +from nose.plugins.capture import Capture from nose.plugins.xunit import Xunit from nose.plugins.skip import Skip from nose.plugins import PluginTester @@ -45,6 +46,22 @@ class TestXUnitPlugin(PluginTester, unittest.TestCase): assert '</testsuite>' in result +class TestIssue134(PluginTester, unittest.TestCase): + activate = '--with-xunit' + args = ['-v','--xunit-file=%s' % xml_results_filename] + plugins = [Capture(), Xunit()] + suitepath = os.path.join(support, 'issue134') + + def runTest(self): + print str(self.output) + f = open(xml_results_filename,'r') + result = f.read() + f.close() + print result + assert 'raise IOError(42, "test")' in result + assert 'tests="1" errors="1" failures="0" skip="0"' in result + + class TestIssue279(PluginTester, unittest.TestCase): activate = '--with-xunit' args = ['-v','--xunit-file=%s' % xml_results_filename] |