From 12c8099846a55ba43bf7d48bab3d01ab697f97a4 Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Tue, 20 Jun 2023 23:10:15 +0200 Subject: [PATCH] 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. --- tests/jobs/test_triggerer_job.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/jobs/test_triggerer_job.py b/tests/jobs/test_triggerer_job.py index fc08b8a5d0803..c3b4e697007ed 100644 --- a/tests/jobs/test_triggerer_job.py +++ b/tests/jobs/test_triggerer_job.py @@ -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):