aboutsummaryrefslogtreecommitdiff
path: root/tests/builder/flags.test.py
diff options
context:
space:
mode:
authornatsuoto <[email protected]>2026-07-16 17:31:49 +0530
committernatsuoto <[email protected]>2026-07-16 17:31:49 +0530
commit1b43c8dc09adb9b54609cc8a1916c99eb6fe75c9 (patch)
tree7731af50ed9117f8ac3d200591c3be23818d7b19 /tests/builder/flags.test.py
parentb7ae2f3885d5ff84237c9da8bc0c64fe1a509465 (diff)
downloadedify-1b43c8dc09adb9b54609cc8a1916c99eb6fe75c9.tar.xz
edify-1b43c8dc09adb9b54609cc8a1916c99eb6fe75c9.zip
chore: enforce fully strict static typing across library, tests, and tooling with zero suppressions
Diffstat (limited to 'tests/builder/flags.test.py')
-rw-r--r--tests/builder/flags.test.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/builder/flags.test.py b/tests/builder/flags.test.py
index 704065f..03b79f4 100644
--- a/tests/builder/flags.test.py
+++ b/tests/builder/flags.test.py
@@ -2,6 +2,7 @@
import re
import sys
+from typing import cast
import pytest
import regex as regex_module
@@ -112,13 +113,15 @@ def test_regex_engine_debug_kwarg_compiles_without_error():
assert compiled.source == "hi"
-def test_regex_engine_debug_flag_is_forwarded_to_regex_module_bitmask(monkeypatch):
+def test_regex_engine_debug_flag_is_forwarded_to_regex_module_bitmask(
+ monkeypatch: pytest.MonkeyPatch,
+):
captured_flags: list[int] = []
original_compile = regex_module.compile
- def capturing_compile(pattern, flags=0):
+ def capturing_compile(pattern: str, flags: int = 0) -> re.Pattern[str]:
captured_flags.append(flags)
- return original_compile(pattern)
+ return cast("re.Pattern[str]", original_compile(pattern))
monkeypatch.setattr(regex_module, "compile", capturing_compile)
RegexBuilder().string("hi").to_regex(engine="regex", debug=True)