diff --git a/tests/test_proxy_connect.py b/tests/test_proxy_connect.py index 160ad6d2f..d3084da18 100644 --- a/tests/test_proxy_connect.py +++ b/tests/test_proxy_connect.py @@ -41,13 +41,8 @@ sys.exit(mitmdump()) '--ssl-insecure', ], stdout=PIPE, env=get_testenv()) - line = self.proc.stdout.read().decode('utf-8') - pattern = r'listening at http://([^:]+:\d+)' - match = re.search(pattern, line) - if not match: - raise RuntimeError('Could not find {} in stdout line {}' - .format(repr(pattern), repr(line))) - host_port = match.group(1) + line = self.proc.stdout.readline().decode('utf-8') + host_port = re.search(r'listening at http://([^:]+:\d+)', line).group(1) address = 'http://%s:%s@%s' % (self.auth_user, self.auth_pass, host_port) return address @@ -64,6 +59,8 @@ def _wrong_credentials(proxy_url): @skipIf(sys.version_info < (3, 5, 4), "requires mitmproxy < 3.0.0, which these tests do not support") +@skipIf("pypy" in sys.executable, + "mitmproxy does not support PyPy") class ProxyConnectTestCase(TestCase): def setUp(self):