whoops, stop warcprox and join thread in test_choose_a_port_for_me

This commit is contained in:
Noah Levitt 2017-04-17 11:47:22 -07:00
parent 1900dfac08
commit 3d87ed61be
2 changed files with 20 additions and 16 deletions

View File

@ -51,7 +51,7 @@ except:
setuptools.setup(
name='warcprox',
version='2.1b1.dev69',
version='2.1b1.dev70',
description='WARC writing MITM HTTP/S proxy',
url='https://github.com/internetarchive/warcprox',
author='Noah Levitt',

View File

@ -1368,6 +1368,7 @@ def test_choose_a_port_for_me(service_registry):
th = threading.Thread(target=controller.run_until_shutdown)
th.start()
try:
# check that service registry entry lists the correct port
start = time.time()
@ -1385,6 +1386,9 @@ def test_choose_a_port_for_me(service_registry):
assert response.status_code == 200
status = json.loads(response.content.decode('ascii'))
assert status['port'] == controller.proxy.server_port
finally:
controller.stop.set()
th.join()
if __name__ == '__main__':
pytest.main()