Skip to content

Commit 48927b8

Browse files
author
DanielePalaia
committed
test
1 parent 2651308 commit 48927b8

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ def test_connection_auth(environment_auth: Environment) -> None:
5050
connection.close()
5151

5252

53+
def test_connection_auth_with_timeout(environment_auth: Environment) -> None:
54+
55+
connection = environment_auth.connection()
56+
connection.dial()
57+
time.sleep(3)
58+
connection.close()
59+
60+
5361
def test_environment_connections_management() -> None:
5462

5563
environment = Environment(uri="amqp://guest:guest@localhost:5672/")

0 commit comments

Comments
 (0)