FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-92886: make test_multiprocessing pass with -O (assertions off) by iritkatriel · Pull Request #98061 · python/cpython · GitHub

Repository navigation

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
32 changes: 19 additions & 13 deletions Lib/test/_test_multiprocessing.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -5698,15 +5698,18 @@ def test_joinable_queue(self):

@classmethod
def _test_list(cls, obj):
assert obj[0] == 5
assert obj.count(5) == 1
assert obj.index(5) == 0
def check(a, b):
if a != b:
raise AssertionError(f"{a} != {b}")
check(obj[0], 5)
check(obj.count(5), 1)
check(obj.index(5), 0)
obj.sort()
obj.reverse()
for x in obj:
pass
assert len(obj) == 1
assert obj.pop(0) == 5
check(len(obj), 1)
check(obj.pop(0), 5)

def test_list(self):
o = self.manager.list()
Expand All @@ -5717,14 +5720,17 @@ 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)
def check(a, b):
if a != b:
raise AssertionError(f"{a} != {b}")
check(len(obj), 1)
check(obj['foo'], 5)
check(obj.get('foo'), 5)
check(list(obj.items()), [('foo', 5)])
check(list(obj.keys()), ['foo'])
check(list(obj.values()), [5])
check(obj.copy(), {'foo': 5})
check(obj.popitem(), ('foo', 5))

def test_dict(self):
o = self.manager.dict()
Expand Down

Back | FazBrowse Home | New Git URL