mirror of
https://github.com/explosion/spaCy.git
synced 2025-07-02 02:43:36 +03:00
Use with for the server
This ensures the server is closed correctly.
This commit is contained in:
parent
eb390fb5f2
commit
c362acb5ce
|
@ -443,7 +443,7 @@ def test_find_available_port():
|
||||||
|
|
||||||
from wsgiref.simple_server import make_server, demo_app
|
from wsgiref.simple_server import make_server, demo_app
|
||||||
|
|
||||||
httpd = make_server(host, port, demo_app)
|
with make_server(host, port, demo_app) as httpd:
|
||||||
with pytest.warns(UserWarning, match="already in use"):
|
with pytest.warns(UserWarning, match="already in use"):
|
||||||
found_port = find_available_port(port, host, auto_select_port=True)
|
found_port = find_available_port(port, host, auto_select_port=True)
|
||||||
assert found_port == port + 1, "Didn't find next port"
|
assert found_port == port + 1, "Didn't find next port"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user