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
e423e077
Commit
e423e077
authored
Oct 14, 2010
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inherit interpreter flags in parallel testing
parent
dc93cd90
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
5 deletions
+22
-5
Lib/test/regrtest.py
Lib/test/regrtest.py
+3
-5
Lib/test/support.py
Lib/test/support.py
+19
-0
No files found.
Lib/test/regrtest.py
View file @
e423e077
...
...
@@ -391,9 +391,6 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
usage
(
"-T and -j don't go together!"
)
if
use_mp
and
findleaks
:
usage
(
"-l and -j don't go together!"
)
if
use_mp
and
max
(
sys
.
flags
):
# TODO: inherit the environment and the flags
print
(
"Warning: flags and environment variables are ignored with -j option"
)
good
=
[]
bad
=
[]
...
...
@@ -534,6 +531,8 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
)
yield (test, args_tuple)
pending = tests_and_args()
opt_args = support.args_from_interpreter_flags()
base_cmd = [sys.executable] + opt_args + ['-m', 'test.regrtest']
def work():
# A worker thread.
try:
...
...
@@ -544,8 +543,7 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
output.put((None, None, None, None))
return
# -E is needed by some tests, e.g. test_import
popen = Popen([sys.executable, '-E', '-m', 'test.regrtest',
'--slaveargs', json.dumps(args_tuple)],
popen = Popen(base_cmd + ['--slaveargs', json.dumps(args_tuple)],
stdout=PIPE, stderr=PIPE,
universal_newlines=True,
close_fds=(os.name != 'nt'))
...
...
Lib/test/support.py
View file @
e423e077
...
...
@@ -1327,3 +1327,22 @@ def strip_python_stderr(stderr):
"""
stderr
=
re
.
sub
(
br"\
[
\d+ refs\
]
\r?\n?$"
,
b""
,
stderr
).
strip
()
return
stderr
def
args_from_interpreter_flags
():
"""Return a list of command-line arguments reproducing the current
settings in sys.flags."""
flag_opt_map
=
{
'bytes_warning'
:
'b'
,
'dont_write_bytecode'
:
'B'
,
'ignore_environment'
:
'E'
,
'no_user_site'
:
's'
,
'no_site'
:
'S'
,
'optimize'
:
'O'
,
'verbose'
:
'v'
,
}
args
=
[]
for
flag
,
opt
in
flag_opt_map
.
items
():
v
=
getattr
(
sys
.
flags
,
flag
)
if
v
>
0
:
args
.
append
(
'-'
+
opt
*
v
)
return
args
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