Skip to content

Commit e09cbd3

Browse files
committed
self.assertRaises causes an allocation, so the _testcapi call
has been moved to immediately before the _channels.create() call to ensure we correctly target the allocation failure.
1 parent 41b655d commit e09cbd3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/test/test_interpreters/test_channels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ def test_lock_allocation_failure(self):
3838
import _testcapi
3939

4040
cid = None
41-
_testcapi.set_nomemory(0, 1)
4241
try:
4342
with self.assertRaises(MemoryError):
43+
_testcapi.set_nomemory(0, 1)
4444
cid = _channels.create()
4545
finally:
4646
_testcapi.remove_mem_hooks()

0 commit comments

Comments
 (0)