diff --git a/sanic/testing.py b/sanic/testing.py index 98ff29e6..df1194fe 100644 --- a/sanic/testing.py +++ b/sanic/testing.py @@ -95,7 +95,10 @@ class SanicTestClient: if self.port: server_kwargs = dict( - host=host or self.host, port=self.port, **server_kwargs + host=host or self.host, + port=self.port, + reuse_port=True, # Try to avoid test failures on Windows + **server_kwargs, ) host, port = host or self.host, self.port else: