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
0bc11ae5
Commit
0bc11ae5
authored
Oct 18, 2009
by
R. David Murray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up merge of r75400.
parent
be4d8094
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
42 deletions
+24
-42
Lib/test/regrtest.py
Lib/test/regrtest.py
+21
-40
Misc/NEWS
Misc/NEWS
+3
-2
No files found.
Lib/test/regrtest.py
View file @
0bc11ae5
...
...
@@ -337,7 +337,7 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
try
:
result
=
runtest
(
*
args
,
**
kwargs
)
except
BaseException
as
e
:
result
=
-
3
,
e
.
__class__
.
__name__
result
=
-
4
,
e
.
__class__
.
__name__
sys
.
stdout
.
flush
()
print
()
# Force a newline (just in case)
print
(
json
.
dumps
(
result
))
...
...
@@ -496,7 +496,7 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
if test is None:
finished += 1
continue
if result[0] == -
3
:
if result[0] == -
4
:
assert result[1] == 'KeyboardInterrupt'
pending.clear()
raise KeyboardInterrupt # What else?
...
...
@@ -804,12 +804,6 @@ def runtest_inner(test, verbose, quiet,
test_time
=
0.0
refleak
=
False
# True if the test leaked references.
try
:
save_stdout
=
sys
.
stdout
# Save various things that tests may mess up so we can restore
# them afterward.
save_environ
=
dict
(
os
.
environ
)
save_argv
=
sys
.
argv
[:]
try
:
if
test
.
startswith
(
'test.'
):
abstest
=
test
...
...
@@ -830,19 +824,6 @@ def runtest_inner(test, verbose, quiet,
refleak
=
dash_R
(
the_module
,
test
,
indirect_test
,
huntrleaks
)
test_time
=
time
.
time
()
-
start_time
finally
:
sys
.
stdout
=
save_stdout
# Restore what we saved if needed, but also complain if the test
# changed it so that the test may eventually get fixed.
if
not
os
.
environ
==
save_environ
:
if
not
quiet
:
print
(
"Warning: os.environ was modified by"
,
test
)
os
.
environ
.
clear
()
os
.
environ
.
update
(
save_environ
)
if
not
sys
.
argv
==
save_argv
:
if
not
quiet
:
print
(
"Warning: argv was modified by"
,
test
)
sys
.
argv
[:]
=
save_argv
except
support
.
ResourceDenied
as
msg
:
if
not
quiet
:
print
(
test
,
"skipped --"
,
msg
)
...
...
Misc/NEWS
View file @
0bc11ae5
...
...
@@ -289,8 +289,9 @@ Tests
- Issue #7055: test___all__ now greedily detects all modules which have an
__all__ attribute, rather than using a hardcoded and incomplete list.
- Issue #7058: Added save/restore for argv and os.environ to runtest_inner
in regrtest, with warnings if the called test modifies them.
- Issue #7058: Added save/restore for things like sys.argv and cwd to
runtest_inner in regrtest, with warnings if the called test modifies them,
and a new section in the summary report at the end.
- Issue #7042: Fix test_signal (test_itimer_virtual) failure on OS X 10.6.
...
...
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