summaryrefslogtreecommitdiff
path: root/t/unit
diff options
context:
space:
mode:
Diffstat (limited to 't/unit')
-rw-r--r--t/unit/test_connection.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/unit/test_connection.py b/t/unit/test_connection.py
index 0b184d3b..83f233cf 100644
--- a/t/unit/test_connection.py
+++ b/t/unit/test_connection.py
@@ -587,6 +587,16 @@ class test_Connection:
conn = Connection('example.com;example.com;')
assert conn.as_uri() == 'amqp://guest:**@example.com:5672//'
+ def test_connection_respect_its_timeout(self):
+ invalid_port = 1222
+ with Connection(
+ f'amqp://guest:guest@localhost:{invalid_port}//',
+ transport_options={'max_retries': 2},
+ connect_timeout=1
+ ) as conn:
+ with pytest.raises(OperationalError):
+ conn.default_channel
+
class test_Connection_with_transport_options: