aboutsummaryrefslogtreecommitdiff
path: root/tests/compile
diff options
context:
space:
mode:
authornatsuoto <[email protected]>2026-07-15 18:12:42 +0530
committernatsuoto <[email protected]>2026-07-15 18:12:42 +0530
commitcf4a4ea68eca91aa044556806d3d91369182702c (patch)
tree2daa50e0f80eda81ec08a4174be56f7ebdc78825 /tests/compile
parent93371d459ad47a46310f729950ec383372cd2706 (diff)
downloadedify-cf4a4ea68eca91aa044556806d3d91369182702c.tar.xz
edify-cf4a4ea68eca91aa044556806d3d91369182702c.zip
chore: codebase-wide rule audit — eliminate Any/object where non-protocol, hoist in-function imports, rename compound/folder-repeat files, replace generic-exception raises, bind chained comprehensions, strip __init__ docstrings, remove pragmas
Diffstat (limited to 'tests/compile')
-rw-r--r--tests/compile/redos.test.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/compile/redos.test.py b/tests/compile/redos.test.py
index c4e1ba9..91786bd 100644
--- a/tests/compile/redos.test.py
+++ b/tests/compile/redos.test.py
@@ -44,25 +44,29 @@ def test_warning_message_names_both_quantifiers():
def test_bounded_quantifier_does_not_trigger_the_warning(recwarn):
builder = RegexBuilder().exactly(3).group().exactly(2).digit().end()
builder.to_regex()
- assert not any(isinstance(warning.message, ReDoSWarning) for warning in recwarn)
+ is_redos_flags = [isinstance(warning.message, ReDoSWarning) for warning in recwarn]
+ assert not any(is_redos_flags)
def test_grouped_quantifier_over_a_composite_group_does_not_trigger(recwarn):
builder = RegexBuilder().one_or_more().group().digit().letter().end()
builder.to_regex()
- assert not any(isinstance(warning.message, ReDoSWarning) for warning in recwarn)
+ is_redos_flags = [isinstance(warning.message, ReDoSWarning) for warning in recwarn]
+ assert not any(is_redos_flags)
def test_grouped_quantifier_over_a_single_non_quantifier_child_does_not_trigger(recwarn):
builder = RegexBuilder().one_or_more().group().digit().end()
builder.to_regex()
- assert not any(isinstance(warning.message, ReDoSWarning) for warning in recwarn)
+ is_redos_flags = [isinstance(warning.message, ReDoSWarning) for warning in recwarn]
+ assert not any(is_redos_flags)
def test_sequential_unbounded_quantifiers_do_not_trigger_the_warning(recwarn):
builder = RegexBuilder().one_or_more().digit().one_or_more().letter()
builder.to_regex()
- assert not any(isinstance(warning.message, ReDoSWarning) for warning in recwarn)
+ is_redos_flags = [isinstance(warning.message, ReDoSWarning) for warning in recwarn]
+ assert not any(is_redos_flags)
def test_warning_only_fires_once_per_construct_within_a_single_terminal_call():