diff options
author | Max Romanov <max.romanov@nginx.com> | 2020-02-04 11:39:34 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2020-02-04 11:39:34 +0300 |
commit | 81b39d0b35d78daabf479ccd492ae8323039b7cb (patch) | |
tree | 53708f86c3e46dc9813aaf56d38cbe2fb486c0c8 /test/test_proxy.py | |
parent | 7c38650cd12b9d5b14aec5d416fa3b57918cee50 (diff) | |
download | unit-81b39d0b35d78daabf479ccd492ae8323039b7cb.tar.gz unit-81b39d0b35d78daabf479ccd492ae8323039b7cb.tar.bz2 |
Tests: fixing Python 3.8.1 errors on Mac.
- "Can't pickle local object ..."
- "if __name__ == '__main__':" pattern required for multiprocessing
Diffstat (limited to 'test/test_proxy.py')
-rw-r--r-- | test/test_proxy.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/test_proxy.py b/test/test_proxy.py index 4697b88f..5d158285 100644 --- a/test/test_proxy.py +++ b/test/test_proxy.py @@ -10,11 +10,12 @@ class TestProxy(TestApplicationPython): SERVER_PORT = 7999 - def run_server(self): + @staticmethod + def run_server(server_port): sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) - server_address = ('', self.SERVER_PORT) + server_address = ('', server_port) sock.bind(server_address) sock.listen(5) @@ -57,7 +58,7 @@ Content-Length: 10 def setUp(self): super().setUp() - self.run_process(self.run_server) + self.run_process(self.run_server, self.SERVER_PORT) self.waitforsocket(self.SERVER_PORT) self.assertIn( |