Skip to content

Commit 12c8099

Browse files
authored
Less precise check for error message in trigger initialization (#32035)
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.
1 parent 43fa157 commit 12c8099

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎tests/jobs/test_triggerer_job.py‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,8 @@ def test_update_trigger_with_triggerer_argument_change(
300300

301301
trigger_runner.update_triggers({1})
302302

303-
assert (
304-
"Trigger failed; message=__init__() got an unexpected keyword argument 'not_exists_arg'"
305-
in caplog.text
306-
)
303+
assert "Trigger failed" in caplog.text
304+
assert "got an unexpected keyword argument 'not_exists_arg'" in caplog.text
307305

308306

309307
def test_trigger_create_race_condition_18392(session, tmp_path):

0 commit comments

Comments
 (0)