Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
92812e46
Commit
92812e46
authored
Apr 29, 2019
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The monkey test runner needs to handle SkipTest exceptions.
parent
0aed91b1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
2 deletions
+20
-2
src/gevent/testing/monkey_test.py
src/gevent/testing/monkey_test.py
+10
-0
src/gevent/testing/testrunner.py
src/gevent/testing/testrunner.py
+7
-1
src/gevent/tests/test___monkey_patching.py
src/gevent/tests/test___monkey_patching.py
+3
-1
No files found.
src/gevent/testing/monkey_test.py
View file @
92812e46
...
...
@@ -23,6 +23,7 @@ from .sysinfo import PY37
from
.patched_tests_setup
import
disable_tests_in_source
from
.
import
support
from
.
import
resources
from
.
import
SkipTest
if
RUNNING_ON_APPVEYOR
and
PY37
:
# 3.7 added a stricter mode for thread cleanup.
...
...
@@ -73,5 +74,14 @@ try:
'exec'
,
dont_inherit
=
True
)
exec
(
module_code
,
globals
())
except
SkipTest
as
e
:
# Some tests can raise test.support.ResourceDenied
# in their main method before the testrunner takes over.
# That's a kind of SkipTest. we can't get a skip count because it
# hasn't run, though.
print
(
e
)
# Match the regular unittest output, including ending with skipped
print
(
"Ran 0 tests in 0.0s"
)
print
(
'OK (skipped=0)'
)
finally
:
os
.
remove
(
temp_path
)
src/gevent/testing/testrunner.py
View file @
92812e46
...
...
@@ -97,6 +97,11 @@ class Runner(object):
failfast
=
False
,
quiet
=
False
,
configured_run_alone_tests
=
()):
"""
:keyword quiet: Set to True or False to explicitly choose. Set to
`None` to use the default, which may come from the environment variable
``GEVENTTEST_QUIET``.
"""
self
.
_tests
=
tests
self
.
_configured_failing_tests
=
configured_failing_tests
self
.
_failfast
=
failfast
...
...
@@ -110,6 +115,7 @@ class Runner(object):
self
.
_worker_count
=
min
(
len
(
tests
),
NWORKERS
)
or
1
def
_run_one
(
self
,
cmd
,
**
kwargs
):
if
self
.
_quiet
is
not
None
:
kwargs
[
'quiet'
]
=
self
.
_quiet
result
=
util
.
run
(
cmd
,
**
kwargs
)
if
not
result
and
self
.
_failfast
:
...
...
src/gevent/tests/test___monkey_patching.py
View file @
92812e46
...
...
@@ -106,7 +106,9 @@ def TESTRUNNER(tests=None):
def
main
():
from
gevent.testing
import
testrunner
return
testrunner
.
Runner
(
list
(
TESTRUNNER
(
sys
.
argv
[
1
:])))()
discovered_tests
=
TESTRUNNER
(
sys
.
argv
[
1
:])
discovered_tests
=
list
(
discovered_tests
)
return
testrunner
.
Runner
(
discovered_tests
,
quiet
=
None
)()
if
__name__
==
'__main__'
:
...
...
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