Use different test server ports to avoid binding problems on Windows.

This commit is contained in:
L. Kärkkäinen 2020-04-01 11:59:01 +03:00
parent 58a122671d
commit 3c4a280e14

View File

@ -24,21 +24,20 @@ def write_app(filename, **runargs):
started = True started = True
print("complete", {text!r}) print("complete", {text!r})
kwargs = {runargs!r}
try: try:
app.run(port=42101, **kwargs) app.run(**{runargs!r})
except Exception as e: except Exception as e:
print("complete", repr(e)) print("complete", repr(e))
else: else:
if not started: if not started:
print("complete SERVER DID NOT START") print("complete DID NOT START")
""" """
)) ))
return text return text
@pytest.mark.parametrize("runargs", [ @pytest.mark.parametrize("runargs,port", [
dict(auto_reload=True), dict(port=42102, auto_reload=True),
dict(debug=True), dict(port=42103, debug=True),
]) ])
async def test_reloader_live(runargs): async def test_reloader_live(runargs):
with TemporaryDirectory() as tmpdir: with TemporaryDirectory() as tmpdir: