Skip to content

Commit

Permalink
used, add test
Browse files Browse the repository at this point in the history
  • Loading branch information
JelleZijlstra committed Sep 27, 2024
1 parent 3c0dcd5 commit d9bf59e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions pyanalyze/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
used(extensions.show_error)
used(extensions.has_extra_keys)
used(extensions.EnumName)
used(extensions.ValidRegex)
used(value.UNRESOLVED_VALUE) # keeping it around for now just in case
used(reexport)
used(patma)
Expand Down
13 changes: 13 additions & 0 deletions pyanalyze/test_implementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1494,3 +1494,16 @@ def capybara():

re.match(r"a", "b")
re.match(rb"(", b"b") # E: incompatible_call

@assert_passes()
def test_extension(self):
from typing_extensions import Annotated

from pyanalyze.extensions import ValidRegex

def f(x: Annotated[str, ValidRegex()]):
pass

def capybara():
f("x")
f(r"[") # E: invalid_regex

0 comments on commit d9bf59e

Please sign in to comment.