From d4c62de2dd353ac53b1c2ae7a5bee343016af4d9 Mon Sep 17 00:00:00 2001 From: Isaac Virshup Date: Tue, 18 Jul 2023 11:49:29 +0200 Subject: [PATCH] Add test cases for passing compiled regex --- testing/code/test_excinfo.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/testing/code/test_excinfo.py b/testing/code/test_excinfo.py index bd72c9ccf..d3d6124c1 100644 --- a/testing/code/test_excinfo.py +++ b/testing/code/test_excinfo.py @@ -2,6 +2,7 @@ import importlib import io import operator import queue +import re import sys import textwrap from pathlib import Path @@ -1665,6 +1666,8 @@ def add_note(err: BaseException, msg: str) -> None: (AssertionError("foo"), ["bar"], "bar"), (AssertionError("foo"), ["bar", "baz"], "bar"), (AssertionError("foo"), ["bar", "baz"], "baz"), + (ValueError("foo"), ["bar", "baz"], re.compile(r"bar\nbaz", re.MULTILINE)), + (ValueError("foo"), ["bar", "baz"], re.compile(r"BAZ", re.IGNORECASE)), ], ) def test_check_error_notes_success(