diff --git a/selftests/functional/test_standalone.py b/selftests/functional/test_standalone.py index 8ab24c4979f9b3df1f4ef19d745e3a7848b0bd13..b6734a48b0492a024ef49f26b677903e9d983d13 100644 --- a/selftests/functional/test_standalone.py +++ b/selftests/functional/test_standalone.py @@ -1,4 +1,5 @@ import os +import sys import unittest from avocado.core import exit_codes @@ -45,7 +46,10 @@ class StandaloneTests(unittest.TestCase): cmd_line = './examples/tests/errortest_nasty.py -r' expected_rc = exit_codes.AVOCADO_TESTS_FAIL result = self.run_and_check(cmd_line, expected_rc, 'errortest_nasty') - exc = "NastyException: Nasty-string-like-exception" + if sys.version_info[0] == 3: + exc = "errortest_nasty.NastyException: Nasty-string-like-exception" + else: + exc = "NastyException: Nasty-string-like-exception" count = result.stdout.count("\n%s" % exc) self.assertEqual(count, 2, "Exception \\n%s should be present twice in" "the log (once from the log, second time when parsing" @@ -62,8 +66,11 @@ class StandaloneTests(unittest.TestCase): cmd_line = './examples/tests/errortest_nasty3.py -r' expected_rc = exit_codes.AVOCADO_TESTS_FAIL result = self.run_and_check(cmd_line, expected_rc, 'errortest_nasty3') - self.assertIn("TestError: