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
e614a824
Commit
e614a824
authored
Apr 29, 2019
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Split the remaining example tests into their own files.
parent
a9b61d6c
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
81 additions
and
83 deletions
+81
-83
src/gevent/testing/testrunner.py
src/gevent/testing/testrunner.py
+2
-4
src/gevent/tests/known_failures.py
src/gevent/tests/known_failures.py
+6
-4
src/gevent/tests/test__example_portforwarder.py
src/gevent/tests/test__example_portforwarder.py
+1
-1
src/gevent/tests/test__example_webproxy.py
src/gevent/tests/test__example_webproxy.py
+29
-0
src/gevent/tests/test__example_wsgiserver.py
src/gevent/tests/test__example_wsgiserver.py
+1
-50
src/gevent/tests/test__example_wsgiserver_ssl.py
src/gevent/tests/test__example_wsgiserver_ssl.py
+24
-0
src/gevent/tests/test__examples.py
src/gevent/tests/test__examples.py
+1
-9
src/gevent/tests/tests_that_dont_monkeypatch.txt
src/gevent/tests/tests_that_dont_monkeypatch.txt
+16
-14
src/gevent/tests/tests_that_dont_use_resolver.txt
src/gevent/tests/tests_that_dont_use_resolver.txt
+1
-1
No files found.
src/gevent/testing/testrunner.py
View file @
e614a824
...
...
@@ -522,11 +522,9 @@ def main():
options
=
parser
.
parse_args
()
# options.use will be either None for not given, or a list
# of the last specified -u argument.
if
options
.
use
is
None
:
# The default, which we'll take from the environment, if set.
options
.
use
=
parse_resources
()
# If not given, use the default, which we'll take from the environment, if set.
options
.
use
=
list
(
set
(
parse_resources
()
if
options
.
use
is
None
else
options
.
use
))
options
.
use
=
list
(
set
(
options
.
use
))
# Whether or not it came from the environment, put it in the
# environment now.
os
.
environ
[
'GEVENTTEST_USE_RESOURCES'
]
=
unparse_resources
(
options
.
use
)
...
...
src/gevent/tests/known_failures.py
View file @
e614a824
...
...
@@ -39,9 +39,6 @@ if sys.platform == 'win32':
# other Windows-related issues (need investigating)
FAILING_TESTS
+=
[
'FLAKY test__greenletset.py'
,
# This has been seen to fail on Py3 and Py2 due to socket reuse
# errors, probably timing related again.
'FLAKY test___example_servers.py'
,
]
if
APPVEYOR
:
...
...
@@ -344,9 +341,14 @@ TEST_FILE_OPTIONS = {
# tests that don't do well when run on busy box
# or that are mutually exclusive
RUN_ALONE
=
[
'test__threadpool.py'
,
'test__examples.py'
,
# These share the same port, which means they can conflict
# between concurrent test runs too
# XXX: Fix this by dynamically picking a port.
'test__example_wsgiserver.py'
,
'test__example_webproxy.py'
,
]
...
...
src/gevent/tests/test__example_portforwarder.py
View file @
e614a824
from
__future__
import
print_function
,
absolute_import
from
gevent
import
monkey
;
monkey
.
patch_all
(
subprocess
=
True
)
import
signal
import
sys
import
socket
from
time
import
sleep
...
...
src/gevent/tests/test__example_webproxy.py
0 → 100644
View file @
e614a824
from
unittest
import
SkipTest
import
gevent.testing
as
greentest
from
.
import
test__example_wsgiserver
@
greentest
.
skipOnCI
(
"Timing issues sometimes lead to a connection refused"
)
@
greentest
.
skipWithoutExternalNetwork
(
"Tries to reach google.com"
)
class
Test_webproxy
(
test__example_wsgiserver
.
Test_wsgiserver
):
server
=
'webproxy.py'
def
_run_all_tests
(
self
):
status
,
data
=
self
.
read
(
'/'
)
self
.
assertEqual
(
status
,
'200 OK'
)
self
.
assertIn
(
b"gevent example"
,
data
)
status
,
data
=
self
.
read
(
'/http://www.google.com'
)
self
.
assertEqual
(
status
,
'200 OK'
)
self
.
assertIn
(
b'google'
,
data
.
lower
())
def
test_a_blocking_client
(
self
):
# Not applicable
raise
SkipTest
(
"Not applicable"
)
if
__name__
==
'__main__'
:
greentest
.
main
()
src/gevent/tests/test__
_example_servers
.py
→
src/gevent/tests/test__
example_wsgiserver
.py
View file @
e614a824
...
...
@@ -4,7 +4,7 @@ try:
from
urllib
import
request
as
urllib2
except
ImportError
:
import
urllib2
from
unittest
import
SkipTest
import
socket
import
ssl
...
...
@@ -89,54 +89,5 @@ class Test_wsgiserver(util.TestServer):
def
test_a_blocking_client
(
self
):
self
.
_do_test_a_blocking_client
()
@
greentest
.
skipOnCI
(
"Timing issues sometimes lead to a connection refused"
)
class
Test_wsgiserver_ssl
(
Test_wsgiserver
):
server
=
'wsgiserver_ssl.py'
URL
=
'https://%s:8443'
%
(
params
.
DEFAULT_LOCAL_HOST_ADDR
,)
PORT
=
8443
_use_ssl
=
True
if
hasattr
(
ssl
,
'_create_unverified_context'
):
# Disable verification for our self-signed cert
# on Python >= 2.7.9 and 3.4
ssl_ctx
=
ssl
.
_create_unverified_context
()
@
greentest
.
skipOnCI
(
"Timing issues sometimes lead to a connection refused"
)
@
greentest
.
skipWithoutExternalNetwork
(
"Tries to reach google.com"
)
class
Test_webproxy
(
Test_wsgiserver
):
server
=
'webproxy.py'
def
_run_all_tests
(
self
):
status
,
data
=
self
.
read
(
'/'
)
self
.
assertEqual
(
status
,
'200 OK'
)
self
.
assertIn
(
b"gevent example"
,
data
)
status
,
data
=
self
.
read
(
'/http://www.google.com'
)
self
.
assertEqual
(
status
,
'200 OK'
)
self
.
assertIn
(
b'google'
,
data
.
lower
())
def
test_a_blocking_client
(
self
):
# Not applicable
raise
SkipTest
(
"Not applicable"
)
# class Test_webpy(Test_wsgiserver):
# server = 'webpy.py'
# not_found_message = 'not found'
#
# def _test_hello(self):
# status, data = self.read('/')
# self.assertEqual(status, '200 OK')
# assert "Hello, world" in data, repr(data)
#
# def _test_long(self):
# start = time.time()
# status, data = self.read('/long')
# delay = time.time() - start
# assert 10 - 0.5 < delay < 10 + 0.5, delay
# self.assertEqual(status, '200 OK')
# self.assertEqual(data, 'Hello, 10 seconds later')
if
__name__
==
'__main__'
:
greentest
.
main
()
src/gevent/tests/test__example_wsgiserver_ssl.py
0 → 100644
View file @
e614a824
import
ssl
import
gevent.testing
as
greentest
from
gevent.testing
import
params
from
.
import
test__example_wsgiserver
@
greentest
.
skipOnCI
(
"Timing issues sometimes lead to a connection refused"
)
class
Test_wsgiserver_ssl
(
test__example_wsgiserver
.
Test_wsgiserver
):
server
=
'wsgiserver_ssl.py'
URL
=
'https://%s:8443'
%
(
params
.
DEFAULT_LOCAL_HOST_ADDR
,)
PORT
=
8443
_use_ssl
=
True
if
hasattr
(
ssl
,
'_create_unverified_context'
):
# Disable verification for our self-signed cert
# on Python >= 2.7.9 and 3.4
ssl_ctx
=
ssl
.
_create_unverified_context
()
if
__name__
==
'__main__'
:
greentest
.
main
()
src/gevent/tests/test__examples.py
View file @
e614a824
...
...
@@ -27,19 +27,11 @@ def _find_files_to_ignore():
try
:
os
.
chdir
(
this_dir
)
# These three are all tested with test___example_servers.
# TODO: Refactor those to regular test__example_*foo* files.
result
=
[
'wsgiserver.py'
,
'wsgiserver_ssl.py'
,
'webproxy.py'
,
]
result
=
[
x
[
14
:]
for
x
in
glob
.
glob
(
'test__example_*.py'
)]
if
greentest
.
PYPY
and
greentest
.
RUNNING_ON_APPVEYOR
:
# For some reason on Windows with PyPy, this times out,
# when it should be very fast.
result
.
append
(
"processes.py"
)
result
+=
[
x
[
14
:]
for
x
in
glob
.
glob
(
'test__example_*.py'
)]
finally
:
os
.
chdir
(
old_dir
)
...
...
src/gevent/tests/tests_that_dont_monkeypatch.txt
View file @
e614a824
test___example_servers.py
test___config.py
test___ident.py
test___monitor.py
test__ares_timeout.py
test__backdoor.py
test__close_backend_fd.py
test__events.py
test__example_echoserver.py
test__example_portforwarder.py
test__example_udp_client.py
test__example_wsgiserver.py
test__example_wsgiserver_ssl.py
test__example_webproxy.py
test__examples.py
test__getaddrinfo_import.py
test__example_portforwarder.py
test__hub_join.py
test__hub_join_timeout.py
test__issue330.py
test__iwait.py
test__monkey_scope.py
test__pywsgi.py
test__server.py
test__server_pywsgi.py
...
...
@@ -12,15 +26,3 @@ test__socket_dns6.py
test__socket_errors.py
test__socket_send_memoryview.py
test__socket_timeout.py
test__examples.py
test__issue330.py
test___ident.py
test___config.py
test___monitor.py
test__events.py
test__monkey_scope.py
test__iwait.py
test__ares_timeout.py
test__close_backend_fd.py
test__hub_join.py
test__hub_join_timeout.py
src/gevent/tests/tests_that_dont_use_resolver.txt
View file @
e614a824
...
...
@@ -18,7 +18,7 @@ test__environ.py
test__event.py
# uses socket test__example_echoserver.py
# uses socket test__example_portforwarder.py
# uses socket test__
_example_servers
.py
# uses socket test__
example_w*
.py
# uses bunch of things test__examples.py
# uses socket test__example_udp_client.py
# uses socket test__example_udp_server.py
...
...
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