diff options
author | John Szakmeister <john@szakmeister.net> | 2015-11-28 05:41:45 -0500 |
---|---|---|
committer | John Szakmeister <john@szakmeister.net> | 2015-11-28 05:41:45 -0500 |
commit | 1082b8ce92af5f3dd89cdbc3487dd86ba211583c (patch) | |
tree | 52cc0a9f36ef3177b9f857e085084a1a64fc4262 | |
parent | 14cbbc3f6d282d9c48bb3d6aa8c048be124780ab (diff) | |
download | nose-1082b8ce92af5f3dd89cdbc3487dd86ba211583c.tar.gz |
Skip distutils.log test if distutils.log is not available.
-rw-r--r-- | unit_tests/test_xunit.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/unit_tests/test_xunit.py b/unit_tests/test_xunit.py index ba839e1..dd54b8d 100644 --- a/unit_tests/test_xunit.py +++ b/unit_tests/test_xunit.py @@ -81,9 +81,18 @@ class TestTee(unittest.TestCase): self.assertTrue(hasattr(tee, 'errors')) def test_tee_works_with_distutils_log(self): - from distutils.log import Log, DEBUG + try: + from distutils.log import Log, DEBUG + except ImportError: + raise SkipTest("distutils.log not available; skipping") + l = Log(DEBUG) - l.warn('Test') + try: + l.warn('Test') + except Exception, e: + self.fail( + "Exception raised while writing to distutils.log: %s" % (e,)) + class TestXMLOutputWithXML(unittest.TestCase): |