Commit a4fbd046 authored by Jason Madden's avatar Jason Madden

Attempt to fix test__backdoor.py

parent dde9546b
......@@ -77,7 +77,7 @@ from greentest.skipping import skipOnLibuvOnCIOnPyPy
from greentest.skipping import skipOnLibuvOnPyPyOnWin
from greentest.skipping import skipOnPurePython
from greentest.skipping import skipWithCExtensions
from greentest.skipping import skipOnLibuvOnTravisOnCPython27
from greentest.exception import ExpectedException
......
......@@ -49,6 +49,7 @@ skipOnLibuvOnWin = _do_not_skip
skipOnLibuvOnCI = _do_not_skip
skipOnLibuvOnCIOnPyPy = _do_not_skip
skipOnLibuvOnPyPyOnWin = _do_not_skip
skipOnLibuvOnTravisOnCPython27 = _do_not_skip
skipOnLibev = _do_not_skip
......@@ -99,6 +100,10 @@ if sysinfo.LIBUV:
skipOnLibuvOnCI = unittest.skip
if sysinfo.PYPY:
skipOnLibuvOnCIOnPyPy = unittest.skip
if sysinfo.RUNNING_ON_TRAVIS:
if sysinfo.CPYTHON:
if sysinfo.PY27_ONLY:
skipOnLibuvOnTravisOnCPython27 = unittest.skip
if sysinfo.WIN:
skipOnLibuvOnWin = unittest.skip
......
......@@ -87,6 +87,8 @@ elif sys.version_info[0] == 2:
PYPY3 = PYPY and PY3
PY27_ONLY = sys.version_info[0] == 2 and sys.version_info[1] == 7
PYGTE279 = (
sys.version_info[0] == 2
and sys.version_info[1] >= 7
......
......@@ -6,8 +6,8 @@ from gevent import backdoor
def read_until(conn, postfix):
read = b''
if not isinstance(postfix, bytes):
postfix = postfix.encode('utf-8')
assert isinstance(postfix, bytes)
while not read.endswith(postfix):
result = conn.recv(1)
if not result:
......@@ -53,7 +53,9 @@ class Test(greentest.TestCase):
conn.close()
self.close_on_teardown.remove(conn)
@greentest.skipOnAppVeyor("Times out")
@greentest.skipOnLibuvOnTravisOnCPython27(
"segfaults; "
"See https://github.com/gevent/gevent/pull/1156")
def test_multi(self):
self._make_server()
......@@ -100,7 +102,7 @@ class Test(greentest.TestCase):
conn = self._create_connection()
read_until(conn, b'>>> ')
conn.sendall(b'locals()["__builtins__"]\r\n')
response = read_until(conn, '>>> ')
response = read_until(conn, b'>>> ')
self.assertTrue(len(response) < 300, msg="locals() unusable: %s..." % response)
self._close(conn)
......@@ -123,7 +125,7 @@ class Test(greentest.TestCase):
conn = self._create_connection()
read_until(conn, b'>>> ')
conn.sendall(b'bad()\r\n')
response = read_until(conn, '>>> ')
response = read_until(conn, b'>>> ')
response = response.replace('\r\n', '\n')
self.assertEqual('switching out, then throwing in\nGot Empty\nswitching out\nswitched in\n>>> ', response)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment