Windows doesn't properly support SO_REUSEADDR, so that's disabled in Python, and thus rebinding fails. For successful testing, reuse port instead.
This commit is contained in:
parent
5f8fc0c850
commit
036c1d7019
|
@ -95,7 +95,10 @@ class SanicTestClient:
|
||||||
|
|
||||||
if self.port:
|
if self.port:
|
||||||
server_kwargs = dict(
|
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
|
host, port = host or self.host, self.port
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user