Skip to content

Commit ad3e2f3

Browse files
committed
fix: Fix tests for python 2.7
1 parent 69ff648 commit ad3e2f3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/test_typing.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# This is test file for typing,
22
# No automatic testing is used at the moment. Just use your type checker and see if it works.
33
# Pytest here is used to make sure that runtime behavir matches with type checker expecter errors.
4-
from decopatch import DECORATED, function_decorator
4+
from typing import Any, Callable
5+
56
import pytest
67

8+
from decopatch import DECORATED, function_decorator
9+
710

811
def test_invalid_parameter():
912
with pytest.raises(TypeError):
@@ -15,7 +18,7 @@ def decorator_wint_invalid_param(fn=DECORATED):
1518

1619
def test_normal_decorator():
1720
@function_decorator
18-
def decorator(scope: str = "test", fn=DECORATED):
21+
def decorator(scope="test", fn=DECORATED): # type: (str, Any) -> Callable[..., Any]
1922
assert isinstance(scope, str)
2023
return fn
2124

@@ -43,7 +46,7 @@ def decorated_with_valid_options():
4346
def test_function_decorator_with_params():
4447
# Ok, should reveal correct type for `enable_stack_introspection`
4548
@function_decorator(enable_stack_introspection=True)
46-
def decorator_with_params(scope: str = "test", fn=DECORATED):
49+
def decorator_with_params(scope = "test", fn=DECORATED): # type: (str, Any) -> Callable[..., Any]
4750
return fn
4851

4952
# Ok, should reveal correct type for `scope`

0 commit comments

Comments
 (0)