summaryrefslogtreecommitdiff
path: root/tests/wsgi_test_conntimeout.py
diff options
context:
space:
mode:
authorJakub Stasiak <jakub@stasiak.at>2015-02-12 00:30:28 +0100
committerJakub Stasiak <jakub@stasiak.at>2015-02-13 02:26:45 +0100
commitea14cd5ee84a2d0c5ba205c9dcc34198a80e9af1 (patch)
treef2de48622506d3a14e06ca1c9d80e1be039158d3 /tests/wsgi_test_conntimeout.py
parent4e1804af31c2ceeed5ff4aa29eab9f1597e7092e (diff)
downloadeventlet-test2.tar.gz
Python 3 compat: Fix all Travis test failurestest2
This patch consists of the following changes: * Splitting eventlet.greenio into base, py2 and py3 parts (eventlet.greenio should be exporing the same public objects). This change is motivated by the size and the number of conditions present in the current greenio code * Connected to the first point: implementing almost completely new GreenPipe callable utilizing parts of old GreenPipe code but dropping _fileobject/SocketIO inheritance in favour of io.FileIO and making use of patched _pyio.open function which wraps raw file-like object in various readers and writers (they take care of the buffering, encoding/decoding etc.) * Implementing (from scratch or updating existing versions) green versions of the following modules: * http.* (needed by Python 3's urllib) * selectors (Python >= 3.4, used in subprocess module) * urllib.* (needed by various tests and we were already exposing green urllib) * Modifying some tests to make tests pass, which includes: * unicode/bytestring issues * modifying wsgi_test_conntimeout.py to not pass bufsize and close arguments to ExplodingSocketFile - on Python 3 it inherits from SocketIO, which doesn't deal with buffering at all as far as I can see * Random cleaning up and reorganizing * Requiring Python 3.x tests to pass for the whole build to pass Known issues: * code repetition * naming inconsistencies * possibly breaking some external code using private eventlet.greenio attributes Closes https://github.com/eventlet/eventlet/issues/108 Affects https://github.com/eventlet/eventlet/issues/6 (I'd call it an experimental support) Should help for https://github.com/eventlet/eventlet/issues/145 Should help for https://github.com/eventlet/eventlet/issues/157
Diffstat (limited to 'tests/wsgi_test_conntimeout.py')
-rw-r--r--tests/wsgi_test_conntimeout.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/wsgi_test_conntimeout.py b/tests/wsgi_test_conntimeout.py
index d925a04..01ecc0e 100644
--- a/tests/wsgi_test_conntimeout.py
+++ b/tests/wsgi_test_conntimeout.py
@@ -25,6 +25,7 @@ connection makefile() file objects - ExplodingSocketFile <-- these raise
from __future__ import print_function
import eventlet
+from eventlet.support import six
import socket
import sys
@@ -96,7 +97,8 @@ class ExplodingConnectionWrap(object):
class ExplodingSocketFile(eventlet.greenio._fileobject):
def __init__(self, sock, mode='rb', bufsize=-1, close=False):
- super(self.__class__, self).__init__(sock, mode, bufsize, close)
+ args = [bufsize, close] if six.PY2 else []
+ super(self.__class__, self).__init__(sock, mode, *args)
self.armed = False
def arm(self):