summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/servers/tests.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/servers/tests.py b/tests/servers/tests.py
index ea64c246e2..a5667f0b19 100644
--- a/tests/servers/tests.py
+++ b/tests/servers/tests.py
@@ -75,7 +75,8 @@ class LiveServerViews(LiveServerBase):
conn.request('GET', '/example_view/', headers={'Connection': 'keep-alive'})
response = conn.getresponse().read()
conn.request('GET', '/example_view/', headers={'Connection': 'close'})
- with self.assertRaises(RemoteDisconnected, msg='Server did not close the connection'):
+ # macOS may give ConnectionResetError.
+ with self.assertRaises((RemoteDisconnected, ConnectionResetError)):
try:
conn.getresponse()
except ConnectionAbortedError: