bpo-45052: Unskips a failing test_shared_memory_basics test (GH-28182)

(cherry picked from commit 19871fce3b)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This commit is contained in:
Miss Islington (bot) 2021-09-06 10:16:44 -07:00 committed by GitHub
parent d5feb2b1f1
commit 6b5aea2dc1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -3771,7 +3771,6 @@ class _TestSharedMemory(BaseTestCase):
local_sms.buf[:len(binary_data)] = binary_data
local_sms.close()
@unittest.skipIf(sys.platform == "win32", "test is broken on Windows")
def test_shared_memory_basics(self):
sms = shared_memory.SharedMemory('test01_tsmb', create=True, size=512)
self.addCleanup(sms.unlink)
@ -3790,7 +3789,6 @@ class _TestSharedMemory(BaseTestCase):
pickled_sms = pickle.dumps(sms)
sms2 = pickle.loads(pickled_sms)
self.assertEqual(sms.name, sms2.name)
self.assertEqual(sms.size, sms2.size)
self.assertEqual(bytes(sms.buf[0:6]), bytes(sms2.buf[0:6]), b'pickle')
# Modify contents of shared memory segment through memoryview.

View file

@ -0,0 +1,7 @@
``WithProcessesTestSharedMemory.test_shared_memory_basics`` test was
ignored, because ``self.assertEqual(sms.size, sms2.size)`` line was failing.
It is now removed and test is unskipped.
The main motivation for this line to be removed from the test is that the
``size`` of ``SharedMemory`` is not ever guaranteed to be the same. It is
decided by the platform.