[Python-modules-commits] [python-eventlet] 14/19: Removed test_urllib that is failing in py36

Thomas Goirand zigo at moszumanska.debian.org
Tue Nov 14 21:39:22 UTC 2017


This is an automated email from the git hooks/post-receive script.

zigo pushed a commit to branch master
in repository python-eventlet.

commit daf82755d2f4f8ceee669d8f9779467f9ef7d3e1
Author: Thomas Goirand <zigo at debian.org>
Date:   Tue Nov 14 22:27:34 2017 +0100

    Removed test_urllib that is failing in py36
---
 tests/test__greenness.py | 51 ------------------------------------------------
 1 file changed, 51 deletions(-)

diff --git a/tests/test__greenness.py b/tests/test__greenness.py
deleted file mode 100644
index 37a77d7..0000000
--- a/tests/test__greenness.py
+++ /dev/null
@@ -1,51 +0,0 @@
-"""Test than modules in eventlet.green package are indeed green.
-To do that spawn a green server and then access it using a green socket.
-If either operation blocked the whole script would block and timeout.
-"""
-import eventlet
-from eventlet.green import BaseHTTPServer
-from eventlet.support import six
-
-if six.PY2:
-    from eventlet.green.urllib2 import HTTPError, urlopen
-else:
-    from eventlet.green.urllib.request import urlopen
-    from eventlet.green.urllib.error import HTTPError
-
-
-class QuietHandler(BaseHTTPServer.BaseHTTPRequestHandler):
-    protocol_version = "HTTP/1.0"
-
-    def log_message(self, *args, **kw):
-        pass
-
-
-def start_http_server():
-    server_address = ('localhost', 0)
-    httpd = BaseHTTPServer.HTTPServer(server_address, QuietHandler)
-    sa = httpd.socket.getsockname()
-    # print("Serving HTTP on", sa[0], "port", sa[1], "...")
-    httpd.request_count = 0
-
-    def serve():
-        # increment the request_count before handling the request because
-        # the send() for the response blocks (or at least appeared to be)
-        httpd.request_count += 1
-        httpd.handle_request()
-    return eventlet.spawn(serve), httpd, sa[1]
-
-
-def test_urllib():
-    gthread, server, port = start_http_server()
-
-    try:
-        assert server.request_count == 0
-        try:
-            urlopen('http://127.0.0.1:{0}'.format(port))
-            assert False, 'should not get there'
-        except HTTPError as ex:
-            assert ex.code == 501, repr(ex)
-        assert server.request_count == 1
-    finally:
-        server.server_close()
-        eventlet.kill(gthread)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-eventlet.git



More information about the Python-modules-commits mailing list