Skip to content

Commit

Permalink
Handle brittle caplog checks (#2033)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtomlinson committed Apr 25, 2024
1 parent e41d608 commit f56d875
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions opsdroid/connector/matrix/tests/test_connector_connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,23 +165,11 @@ async def test_connect_set_nick_errors(
await connector.connect()
await connector.disconnect()

assert caplog.record_tuples == [
(
"nio.responses",
logging.WARNING,
"Error validating response: 'displayname' is a required property",
),
(
"opsdroid.connector.matrix.connector",
logging.WARNING,
"Error fetching current display_name: unknown error (status code None)",
),
(
"opsdroid.connector.matrix.connector",
logging.WARNING,
"Error setting display_name: Invalid user (status code M_FORBIDDEN)",
),
]
assert (
"Error validating response: 'displayname' is a required property" in caplog.text
)
assert "Error fetching current display_name" in caplog.text
assert "M_FORBIDDEN" in caplog.text

caplog.clear()

Expand Down

0 comments on commit f56d875

Please sign in to comment.