Skip to content

Commit 481b58c

Browse files
Uncomment two tests and xfail them instead, to reduce the chance of code rot.
These had already broken as fixtures are pyi files and not py files, now.
1 parent 6484430 commit 481b58c

File tree

1 file changed

+45
-42
lines changed

1 file changed

+45
-42
lines changed

test-data/unit/typexport-basic.test

Lines changed: 45 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -366,48 +366,51 @@ NameExpr(6) : def () -> A
366366
NameExpr(6) : def (a: Any) -> Tuple[Any, Any]
367367
TypeApplication(6) : def (a: Any) -> Tuple[Any, Any]
368368

369-
-- NOTE: Type applications are not supported for generic methods, so the
370-
-- following test cases are commented out.
371-
372-
--[case testGenericMethodCallWithTypeApp]
373-
--## CallExpr|MemberExpr|TypeApplication
374-
--from typing import Any, TypeVar, Tuple
375-
--T = TypeVar('T')
376-
--class A:
377-
-- def f(self, a: T) -> Tuple[T, T]: pass
378-
--a.f[A](a)
379-
--a.f[Any](a)
380-
--a = None # type: A
381-
--[builtins fixtures/tuple.py]
382-
--[out]
383-
--CallExpr(2) : Tuple[A, A]
384-
--MemberExpr(2) : def (A a) -> Tuple[A, A]
385-
--TypeApplication(2) : def (A a) -> Tuple[A, A]
386-
--CallExpr(3) : Tuple[Any, Any]
387-
--MemberExpr(3) : def (any a) -> Tuple[Any, Any]
388-
--TypeApplication(3) : def (any a) -> Tuple[Any, Any]
389-
390-
--[case testGenericMethodCallInGenericTypeWithTypeApp]
391-
--## CallExpr|MemberExpr|TypeApplication
392-
--from typing import Any, TypeVar, Generic, Tuple
393-
--T = TypeVar('T')
394-
--S = TypeVar('S')
395-
--class B: pass
396-
--class C: pass
397-
--a.f[B](b)
398-
--a.f[Any](b)
399-
--class A(Generic[T]):
400-
-- def f(self, a: S) -> Tuple[T, S]: pass
401-
--a = None # type: A[C]
402-
--b = None # type: B
403-
--[builtins fixtures/tuple.py]
404-
--[out]
405-
--CallExpr(6) : Tuple[C, B]
406-
--MemberExpr(6) : def (B a) -> Tuple[C, B]
407-
--TypeApplication(6) : def (B a) -> Tuple[C, B]
408-
--CallExpr(7) : Tuple[C, Any]
409-
--MemberExpr(7) : def (any a) -> Tuple[C, Any]
410-
--TypeApplication(7) : def (any a) -> Tuple[C, Any]
369+
[case testGenericMethodCallWithTypeApp-xfail]
370+
## CallExpr|MemberExpr|TypeApplication
371+
-- NOTE: Type applications are not supported for generic methods, so
372+
-- this test case is xfailed. But not deleted outright because, at least
373+
-- as of 2013, we thought it might be relevant in the future.
374+
from typing import Any, TypeVar, Tuple
375+
T = TypeVar('T')
376+
class A:
377+
def f(self, a: T) -> Tuple[T, T]: pass
378+
a.f[A](a)
379+
a.f[Any](a)
380+
a = None # type: A
381+
[builtins fixtures/tuple.pyi]
382+
[out]
383+
CallExpr(2) : Tuple[A, A]
384+
MemberExpr(2) : def (A a) -> Tuple[A, A]
385+
TypeApplication(2) : def (A a) -> Tuple[A, A]
386+
CallExpr(3) : Tuple[Any, Any]
387+
MemberExpr(3) : def (any a) -> Tuple[Any, Any]
388+
TypeApplication(3) : def (any a) -> Tuple[Any, Any]
389+
390+
[case testGenericMethodCallInGenericTypeWithTypeApp-xfail]
391+
## CallExpr|MemberExpr|TypeApplication
392+
-- NOTE: Type applications are not supported for generic methods, so
393+
-- this test case is xfailed. But not deleted outright because, at least
394+
-- as of 2013, we thought it might be relevant in the future.
395+
from typing import Any, TypeVar, Generic, Tuple
396+
T = TypeVar('T')
397+
S = TypeVar('S')
398+
class B: pass
399+
class C: pass
400+
a.f[B](b)
401+
a.f[Any](b)
402+
class A(Generic[T]):
403+
def f(self, a: S) -> Tuple[T, S]: pass
404+
a = None # type: A[C]
405+
b = None # type: B
406+
[builtins fixtures/tuple.pyi]
407+
[out]
408+
CallExpr(6) : Tuple[C, B]
409+
MemberExpr(6) : def (B a) -> Tuple[C, B]
410+
TypeApplication(6) : def (B a) -> Tuple[C, B]
411+
CallExpr(7) : Tuple[C, Any]
412+
MemberExpr(7) : def (any a) -> Tuple[C, Any]
413+
TypeApplication(7) : def (any a) -> Tuple[C, Any]
411414

412415
[case testGenericTypeVariableInference]
413416
from typing import TypeVar, Generic

0 commit comments

Comments
 (0)