Skip to content

Commit

Permalink
fix tests on python >=3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
leifwalsh authored Dec 20, 2023
1 parent 03962ff commit 5b1f52f
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions marbles/core/tests/test_setuptools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

Expand Down

0 comments on commit 5b1f52f

Please sign in to comment.