Skip to content

Commit

Permalink
Less precise check for error message in trigger initialization (#32035)
Browse files Browse the repository at this point in the history
The test for error message (introduced in #31999) in trigger
initialization expected precise error message, however Python 3.10
changed the details printed when TypeError was converted to string
(including the information about class being created not only method).
This caused the tests to fail on Python 3.10 and 3.11.

Making two asserts with two parts of the message expected solves
the problem for all python versions.
  • Loading branch information
potiuk authored Jun 20, 2023
1 parent 43fa157 commit 12c8099
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/jobs/test_triggerer_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,8 @@ def test_update_trigger_with_triggerer_argument_change(

trigger_runner.update_triggers({1})

assert (
"Trigger failed; message=__init__() got an unexpected keyword argument 'not_exists_arg'"
in caplog.text
)
assert "Trigger failed" in caplog.text
assert "got an unexpected keyword argument 'not_exists_arg'" in caplog.text


def test_trigger_create_race_condition_18392(session, tmp_path):
Expand Down

0 comments on commit 12c8099

Please sign in to comment.