summaryrefslogtreecommitdiff
path: root/tests/socket_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/socket_test.py')
-rw-r--r--tests/socket_test.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/socket_test.py b/tests/socket_test.py
index 954eba3..9d725b5 100644
--- a/tests/socket_test.py
+++ b/tests/socket_test.py
@@ -91,3 +91,14 @@ def test_getaddrinfo_ipv6_scope():
if not socket.has_ipv6:
return
socket.getaddrinfo('::1%2', 80, socket.AF_INET6)
+
+
+def test_error_is_timeout():
+ s1, _ = socket.socketpair()
+ s1.settimeout(0.01)
+ try:
+ s1.recv(1)
+ except socket.error as e:
+ tests.check_is_timeout(e)
+ else:
+ assert False, 'No timeout, socket.error was not raised'