BF: (travis) if tests ran under coverage -- there is a traceback parts to report (thus > would be present)

pull/227/head
Yaroslav Halchenko 2013-05-12 23:42:01 -04:00
parent 1b301d723d
commit 6aed705f3d
1 changed files with 7 additions and 1 deletions

View File

@ -133,7 +133,13 @@ class TestsUtilsTest(unittest.TestCase):
print deep_function(3)
except ValueError:
s = tb()
self.assertFalse('>' in s, msg="'>' present in %r" % s) # There is only "fail2ban-testcases" in this case, no true traceback
# if we run it through 'coverage' (e.g. on travis) then we
# would get a traceback
if 'coverage' in s:
self.assertTrue('>' in s, msg="no '>' in %r" % s)
else:
self.assertFalse('>' in s, msg="'>' present in %r" % s) # There is only "fail2ban-testcases" in this case, no true traceback
self.assertTrue(':' in s, msg="no ':' in %r" % s)