Skip to content

Commit

Permalink
Also cover the async test
Browse files Browse the repository at this point in the history
  • Loading branch information
gerzse committed Jul 4, 2024
1 parent e4ac10c commit 47df571
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions tests/test_asyncio/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,21 +549,3 @@ async def test_unix_socket_connection_failure():
str(e.value)
== "Error 2 connecting to unix:///tmp/a.sock. No such file or directory."
)


@pytest.mark.parametrize(
"error, expected_message",
[
(OSError(), "Error connecting to localhost:6379. Connection reset by peer"),
(OSError(12), "Error connecting to localhost:6379. 12."),
(
OSError(12, "Some Error"),
"Error 12 connecting to localhost:6379. [Errno 12] Some Error.",
),
],
)
async def test_connect_error_message(error, expected_message):
"""Test that the _error_message function formats errors correctly"""
conn = Connection()
error_message = conn._error_message(error)
assert error_message == expected_message

0 comments on commit 47df571

Please sign in to comment.