Skip to content

Commit

Permalink
Skip distutils.log test if distutils.log is not available.
Browse files Browse the repository at this point in the history
  • Loading branch information
jszakmeister committed Nov 28, 2015
1 parent 14cbbc3 commit 1082b8c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions unit_tests/test_xunit.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,18 @@ def test_tee_has_error_and_encoding_attributes(self):
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):

Expand Down

0 comments on commit 1082b8c

Please # to comment.