Skip to content

Commit 19871fc

Browse files
authored
bpo-45052: Unskips a failing test_shared_memory_basics test (GH-28182)
1 parent 37272f5 commit 19871fc

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

‎Lib/test/_test_multiprocessing.py

-2
Original file line numberDiff line numberDiff line change
@@ -3773,7 +3773,6 @@ def _attach_existing_shmem_then_write(shmem_name_or_obj, binary_data):
37733773
local_sms.buf[:len(binary_data)] = binary_data
37743774
local_sms.close()
37753775

3776-
@unittest.skipIf(sys.platform == "win32", "test is broken on Windows")
37773776
def test_shared_memory_basics(self):
37783777
sms = shared_memory.SharedMemory('test01_tsmb', create=True, size=512)
37793778
self.addCleanup(sms.unlink)
@@ -3792,7 +3791,6 @@ def test_shared_memory_basics(self):
37923791
pickled_sms = pickle.dumps(sms)
37933792
sms2 = pickle.loads(pickled_sms)
37943793
self.assertEqual(sms.name, sms2.name)
3795-
self.assertEqual(sms.size, sms2.size)
37963794
self.assertEqual(bytes(sms.buf[0:6]), bytes(sms2.buf[0:6]), b'pickle')
37973795

37983796
# Modify contents of shared memory segment through memoryview.
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)