Skip to content

Commit

Permalink
Add test coverage for string type annotations
Browse files Browse the repository at this point in the history
The `Temp` test class must be moved to global variables for name resolution to succeed
  • Loading branch information
zanieb authored and tombh committed Jul 26, 2023
1 parent 7ccd711 commit 10f2ee0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/test_feature_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,23 @@
from typeguard import TypeCheckError
from typeguard._utils import qualified_name

class Temp:
pass

def test_has_ls_param_or_annotation():
class Temp:
pass

def test_has_ls_param_or_annotation():
def f1(ls, a, b, c):
pass

def f2(temp: Temp, a, b, c):
pass

def f3(temp: "Temp", a, b, c):
pass

assert has_ls_param_or_annotation(f1, None)
assert has_ls_param_or_annotation(f2, Temp)
assert has_ls_param_or_annotation(f3, Temp)


def test_register_command_validation_error(feature_manager):
Expand Down

0 comments on commit 10f2ee0

Please sign in to comment.