Skip to content

Commit

Permalink
Add tests for decorating ParamSpec (#12555)
Browse files Browse the repository at this point in the history
  • Loading branch information
Akuli authored Apr 10, 2022
1 parent 965c6c9 commit 6a24e1d
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test-data/unit/check-parameter-specification.test
Original file line number Diff line number Diff line change
Expand Up @@ -997,6 +997,29 @@ a3 = f2
a3 = f1
[builtins fixtures/tuple.pyi]

[case testDecoratingClassesThatUseParamSpec]
from typing import Generic, TypeVar, Callable, Any
from typing_extensions import ParamSpec

_P = ParamSpec("_P")
_T = TypeVar("_T")
_F = TypeVar("_F", bound=Callable[..., Any])

def f(x: _F) -> _F: ...

@f # Should be ok
class OnlyParamSpec(Generic[_P]):
pass

@f # Should be ok
class MixedWithTypeVar1(Generic[_P, _T]):
pass

@f # Should be ok
class MixedWithTypeVar2(Generic[_T, _P]):
pass
[builtins fixtures/dict.pyi]

[case testGenericsInInferredParamspec]
from typing import Callable, TypeVar, Generic
from typing_extensions import ParamSpec
Expand Down

0 comments on commit 6a24e1d

Please sign in to comment.