From 3bf84af74812937803dc1eda57a0e988a9d5c237 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Wed, 17 Jun 2020 18:36:27 +0200 Subject: [PATCH] Disable tests based on mitmproxy while running on PyPy --- tests/test_proxy_connect.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) 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):