Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
7f233974
Commit
7f233974
authored
Aug 02, 2020
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a unit test for testing spawn. Ref pypa/distutils#5.
parent
1215561b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
distutils/tests/test_msvccompiler.py
distutils/tests/test_msvccompiler.py
+23
-0
No files found.
distutils/tests/test_msvccompiler.py
View file @
7f233974
...
...
@@ -2,6 +2,7 @@
import
sys
import
unittest
import
os
import
threading
from
distutils.errors
import
DistutilsPlatformError
from
distutils.tests
import
support
...
...
@@ -74,6 +75,28 @@ class msvccompilerTestCase(support.TempdirManager,
else
:
raise
unittest
.
SkipTest
(
"VS 2015 is not installed"
)
class
TestSpawn
(
unittest
.
TestCase
):
def
test_concurrent_safe
(
self
):
"""
Concurrent calls to spawn should have consistent results.
"""
import
distutils._msvccompiler
as
_msvccompiler
compiler
=
_msvccompiler
.
MSVCCompiler
()
compiler
.
_paths
=
"expected"
inner_cmd
=
'import os; assert os.environ["PATH"] == "expected"'
command
=
[
'python'
,
'-c'
,
inner_cmd
]
threads
=
[
threading
.
Thread
(
target
=
compiler
.
spawn
,
args
=
[
command
])
for
n
in
range
(
100
)
]
for
thread
in
threads
:
thread
.
start
()
for
thread
in
threads
:
thread
.
join
()
def
test_suite
():
return
unittest
.
makeSuite
(
msvccompilerTestCase
)
...
...
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