From 6aed705f3dd3567256666304c72e2eecedf5f0a3 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Sun, 12 May 2013 23:42:01 -0400 Subject: [PATCH] BF: (travis) if tests ran under coverage -- there is a traceback parts to report (thus > would be present) --- testcases/misctestcase.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/testcases/misctestcase.py b/testcases/misctestcase.py index d63f8afc..84eafa01 100644 --- a/testcases/misctestcase.py +++ b/testcases/misctestcase.py @@ -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)