diff --git a/marbles/core/tests/test_setuptools.py b/marbles/core/tests/test_setuptools.py index 0ef7275..dc98dd0 100644 --- a/marbles/core/tests/test_setuptools.py +++ b/marbles/core/tests/test_setuptools.py @@ -52,10 +52,10 @@ def test_locals(self): def test_tests_run(self): expected_lines = [ - 'test_test (tests.test_two.TestTest) ... ok', - 'test_test (tests.test.TestTest) ... FAIL', - 'Ran 2 tests in', - ] + 'test_test (tests.test_two.TestTest) ... ok', + 'test_test (tests.test.TestTest) ... FAIL', + 'Ran 2 tests in', + ] for e in expected_lines: self.assertIn(e, self.stderr) @@ -79,19 +79,19 @@ def test_locals(self): def test_tests_run(self): expected_lines = [ - 'test_neg_nums (tests.namespace.core.test.TestCase) ... ok', - 'test_pos_nums (tests.namespace.core.test.TestCase) ... FAIL', - 'Ran 2 tests in', - ] + r'test_neg_nums \(tests\.namespace\.core\.test\.TestCase(\.test_neg_nums)?\) \.\.\. ok', # noqa: E501 + r'test_pos_nums \(tests\.namespace\.core\.test\.TestCase(\.test_pos_nums)?\) \.\.\. FAIL', # noqa: E501 + r'Ran 2 tests in', + ] for e in expected_lines: - self.assertIn(e, self.stderr) + self.assertRegexpMatches(self.stderr, e) def test_source(self): expected_lines = [ - 'Source', - 'for i in range(10)', - 'self.assertEqual(i*2, m.double(i))' - ] + 'Source', + 'for i in range(10)', + 'self.assertEqual(i*2, m.double(i))' + ] for e in expected_lines: self.assertIn(e, self.stderr)