This commit is contained in:
Allan Olweny 2024-07-02 13:13:04 -07:00 committed by GitHub
commit a8770bcc97
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 0 deletions

View File

@ -1917,6 +1917,13 @@ def parse_warning_filter(
raise UsageError(error_template.format(error=exception_text)) from None
if message and escape:
message = re.escape(message)
if "()" in message:
warning = dedent(
"""
An empty group '()' will not match a string that contains literal parenthesis
"""
)
warnings.warn(PytestConfigWarning(warning))
if module and escape:
module = re.escape(module) + r"\Z"
if lineno_: