Commit 0c1d7fcd authored by Jason Madden's avatar Jason Madden

Tweaks for PyPy3 on Linux.

parent d5782662
......@@ -54,11 +54,19 @@ class Test(greentest.TestCase):
raise
raise AssertionError('NOT RAISED EBADF: %r() returned %r' % (func, result))
def assert_fd_open(self, fileno):
assert isinstance(fileno, fd_types)
open_files = get_open_files()
if fileno not in open_files:
raise AssertionError('%r is not open:\n%s' % (fileno, open_files['data']))
if WIN or (PYPY and PY3 and greentest.LINUX):
def __assert_fd_open(self, fileno):
# We can't detect open file descriptors on Windows.
# On PyPy 3.6-7.3 on Travis CI (linux), for some reason the
# client file descriptors don't always show as open. Don't know why,
# was fine in 7.2.
pass
else:
def __assert_fd_open(self, fileno):
assert isinstance(fileno, fd_types)
open_files = get_open_files()
if fileno not in open_files:
raise AssertionError('%r is not open:\n%s' % (fileno, open_files['data']))
def assert_fd_closed(self, fileno):
assert isinstance(fileno, fd_types), repr(fileno)
......@@ -79,21 +87,14 @@ class Test(greentest.TestCase):
def assert_open(self, sock, *rest):
if isinstance(sock, fd_types):
if WIN or (PYPY and PY3 and greentest.LINUX):
# We can't detect open file descriptors on Windows.
# On PyPy 3.6-7.3 on Travis CI (linux), for some reason the
# client file descriptors don't always show as open. Don't know why,
# was fine in 7.2.
pass
else:
self.assert_fd_open(sock)
self.__assert_fd_open(sock)
else:
fileno = sock.fileno()
assert isinstance(fileno, fd_types), fileno
sockname = sock.getsockname()
assert isinstance(sockname, tuple), sockname
if not WIN:
self.assert_fd_open(fileno)
self.__assert_fd_open(fileno)
else:
self._assert_sock_open(sock)
if rest:
......
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