summaryrefslogtreecommitdiff
path: root/t/integration/test_rmq.py
diff options
context:
space:
mode:
Diffstat (limited to 't/integration/test_rmq.py')
-rw-r--r--t/integration/test_rmq.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/t/integration/test_rmq.py b/t/integration/test_rmq.py
index e5f0496..71ecaf3 100644
--- a/t/integration/test_rmq.py
+++ b/t/integration/test_rmq.py
@@ -1,6 +1,8 @@
from __future__ import absolute_import, unicode_literals
import os
+import threading
+import logging
import pytest
@@ -146,3 +148,21 @@ class test_rabbitmq_operations():
queue='py-amqp-unittest',
)
assert msg is None
+
+
+def test_threadsafty(caplog, connection):
+ caplog.set_level(logging.DEBUG)
+ connection.connect()
+
+ def worker():
+ connection.channel()
+
+ threads = [threading.Thread(target=worker) for _ in range(2)]
+
+ for t in threads:
+ t.start()
+
+ for t in threads:
+ t.join(timeout=30)
+
+ connection.close()