8000 gh-92886: fixed tests that were breaking while running with basic optimizations enabled (-O, assertions off) by jackh-ncl · Pull Request #93174 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-92886: fixed tests that were breaking while running with basic optimizations enabled (-O, assertions off) #93174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 14 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Brining other assertions in line in _test_multiprocessing.py
  • Loading branch information
jackh-ncl committed May 24, 2022
commit 39261656fe11db97272463aa913a5f23deeb88f3
38 changes: 21 additions & 17 deletions Lib/test/_test_multiprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -5710,26 +5710,28 @@ def test_list(self):

@classmethod
def _test_dict(cls, obj):
assert len(obj) == 1
assert obj['foo'] == 5
assert obj.get('foo') == 5
assert list(obj.items()) == [('foo', 5)]
assert list(obj.keys()) == ['foo']
assert list(obj.values()) == [5]
assert obj.copy() == {'foo': 5}
assert obj.popitem() == ('foo', 5)
case = unittest.TestCase()
case.assertEqual(len(obj), 1)
case.assertEqual(obj['foo'], 5)
case.assertEqual(obj.get('foo'), 5)
case.assertListEqual(list(obj.items()), [('foo', 5)])
case.assertListEqual(list(obj.keys()), ['foo'])
case.assertListEqual(list(obj.values()), [5])
case.assertDictEqual(obj.copy(), {'foo': 5})
case.assertTupleEqual(obj.popitem(), ('foo', 5))

def test_dict(self):
o = self.manager.dict()
o['foo'] = 5
self.run_worker(self._test_dict, o)
assert not o
self.assertIsNotNone(o)
self.assertEqual(len(o), 0)

@classmethod
def _test_value(cls, obj):
assert obj.value == 1
assert obj.get() == 1
case = unittest.TestCase()
case.assertEqual(obj.value, 1)
case.assertEqual(obj.get(), 1)
obj.set(2)

def test_value(self):
Expand All @@ -5740,19 +5742,21 @@ def test_value(self):

@classmethod
def _test_array(cls, obj):
assert obj[0] == 0
assert obj[1] == 1
assert len(obj) == 2
assert list(obj) == [0, 1]
case = unittest.TestCase()
case.assertEqual(obj[0], 0)
case.assertEqual(obj[1], 1)
case.assertEqual(len(obj), 2)
case.assertListEqual(list(obj), [0, 1])

def test_array(self):
o = self.manager.Array('i', [0, 1])
self.run_worker(self._test_array, o)

@classmethod
def _test_namespace(cls, obj):
assert obj.x == 0
assert obj.y == 1
case = unittest.TestCase()
case.assertEqual(obj.x, 0)
case.assertEqual(obj.y, 1)

def test_namespace(self):
o = self.manager.Namespace()
Expand Down
0