Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
2fc1160a
Commit
2fc1160a
authored
Sep 10, 2019
by
Vinay Sharma
Committed by
Pablo Galindo
Sep 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-38018: Fix test for multiprocessing.shared_memory in BSD systems (GH-15821)
parent
c59295a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
Lib/test/_test_multiprocessing.py
Lib/test/_test_multiprocessing.py
+7
-2
No files found.
Lib/test/_test_multiprocessing.py
View file @
2fc1160a
...
...
@@ -3732,16 +3732,21 @@ class _TestSharedMemory(BaseTestCase):
with
unittest
.
mock
.
patch
(
'multiprocessing.shared_memory._make_filename'
)
as
mock_make_filename
:
NAME_PREFIX
=
shared_memory
.
_SHM_NAME_PREFIX
names
=
[
'test01_fn'
,
'test02_fn'
]
# Prepend NAME_PREFIX which can be '/psm_' or 'wnsm_', necessary
# because some POSIX compliant systems require name to start with /
names
=
[
NAME_PREFIX
+
name
for
name
in
names
]
mock_make_filename
.
side_effect
=
names
shm1
=
shared_memory
.
SharedMemory
(
create
=
True
,
size
=
1
)
self
.
addCleanup
(
shm1
.
unlink
)
self
.
assertEqual
(
shm1
.
name
,
names
[
0
])
self
.
assertEqual
(
shm1
.
_
name
,
names
[
0
])
mock_make_filename
.
side_effect
=
names
shm2
=
shared_memory
.
SharedMemory
(
create
=
True
,
size
=
1
)
self
.
addCleanup
(
shm2
.
unlink
)
self
.
assertEqual
(
shm2
.
name
,
names
[
1
])
self
.
assertEqual
(
shm2
.
_
name
,
names
[
1
])
if
shared_memory
.
_USE_POSIX
:
# Posix Shared Memory can only be unlinked once. Here we
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment