From: Miro HronĨok Date: Tue, 2 Nov 2021 15:47:28 +0000 (+0100) Subject: Tests: Make "Traceback did not match" an actual f-string X-Git-Tag: 3.1.0~27^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1525%2Fhead;p=thirdparty%2Fjinja.git Tests: Make "Traceback did not match" an actual f-string Otherwise the failure looks like this: > assert ( m is not None ), "Traceback did not match:\n\n{''.join(tb)}\nexpected:\n{expected_tb}" E AssertionError: Traceback did not match: E E {''.join(tb)} E expected: E {expected_tb} E assert None is not None --- diff --git a/tests/test_debug.py b/tests/test_debug.py index 0aec78ae..c639bbc2 100644 --- a/tests/test_debug.py +++ b/tests/test_debug.py @@ -25,7 +25,7 @@ class TestDebug: m = re.search(expected_tb.strip(), "".join(tb)) assert ( m is not None - ), "Traceback did not match:\n\n{''.join(tb)}\nexpected:\n{expected_tb}" + ), f"Traceback did not match:\n\n{''.join(tb)}\nexpected:\n{expected_tb}" def test_runtime_error(self, fs_env): def test():