Skip to content

Commit 62f23c8

Browse files
author
DanielePalaia
committed
test
1 parent 2651308 commit 62f23c8

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

tests/conftest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ def environment_auth(pytestconfig):
4646
uri="amqp://localhost:5672",
4747
oauth2_options=OAuth2Options(token=token_string),
4848
)
49-
# try:
50-
return environment
49+
try:
50+
yield environment
5151

52-
# finally:
53-
# environment.close()
52+
finally:
53+
environment.close()
5454

5555

5656
@pytest.fixture()

tests/test_connection.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ def test_connection_auth(environment_auth: Environment) -> None:
4949
connection.dial()
5050
connection.close()
5151

52+
def test_connection_auth_with_timeout(environment_auth: Environment) -> None:
53+
54+
connection = environment_auth.connection()
55+
connection.dial()
56+
time.sleep(3)
57+
connection.close()
58+
5259

5360
def test_environment_connections_management() -> None:
5461

0 commit comments

Comments
 (0)