Skip to content

Commit 6b5aea2

Browse files
bpo-45052: Unskips a failing test_shared_memory_basics test (GH-28182)
(cherry picked from commit 19871fc) Co-authored-by: Nikita Sobolev <[email protected]>
1 parent d5feb2b commit 6b5aea2

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Lib/test/_test_multiprocessing.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3771,7 +3771,6 @@ def _attach_existing_shmem_then_write(shmem_name_or_obj, binary_data):
37713771
local_sms.buf[:len(binary_data)] = binary_data
37723772
local_sms.close()
37733773

3774-
@unittest.skipIf(sys.platform == "win32", "test is broken on Windows")
37753774
def test_shared_memory_basics(self):
37763775
sms = shared_memory.SharedMemory('test01_tsmb', create=True, size=512)
37773776
self.addCleanup(sms.unlink)
@@ -3790,7 +3789,6 @@ def test_shared_memory_basics(self):
37903789
pickled_sms = pickle.dumps(sms)
37913790
sms2 = pickle.loads(pickled_sms)
37923791
self.assertEqual(sms.name, sms2.name)
3793-
self.assertEqual(sms.size, sms2.size)
37943792
self.assertEqual(bytes(sms.buf[0:6]), bytes(sms2.buf[0:6]), b'pickle')
37953793

37963794
# Modify contents of shared memory segment through memoryview.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
``WithProcessesTestSharedMemory.test_shared_memory_basics`` test was
2+
ignored, because ``self.assertEqual(sms.size, sms2.size)`` line was failing.
3+
It is now removed and test is unskipped.
4+
5+
The main motivation for this line to be removed from the test is that the
6+
``size`` of ``SharedMemory`` is not ever guaranteed to be the same. It is
7+
decided by the platform.

0 commit comments

Comments
 (0)