Skip to content

Commit cf2dcaf

Browse files
committed
Add a few fine-grained tests (of which testAddFunctionDeprecationIndirectImport1-only_when_nocache) fails due to currently unknown reasons.
1 parent 8c0260e commit cf2dcaf

File tree

1 file changed

+136
-0
lines changed

1 file changed

+136
-0
lines changed

test-data/unit/fine-grained.test

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10545,3 +10545,139 @@ m.py:9: error: Argument 1 to "foo" has incompatible type "int"; expected "str"
1054510545
m.py:9: error: Argument 2 to "foo" has incompatible type "str"; expected "int"
1054610546
m.py:10: error: Unexpected keyword argument "a" for "foo"
1054710547
partial.py:4: note: "foo" defined here
10548+
10549+
[case testAddKeepChangeAndRemoveFunctionDeprecation]
10550+
from a import f
10551+
f()
10552+
import a
10553+
a.f()
10554+
10555+
[file a.py]
10556+
def f() -> None: ...
10557+
10558+
[file a.py.2]
10559+
from typing_extensions import deprecated
10560+
@deprecated("use f2 instead")
10561+
def f() -> None: ...
10562+
10563+
[file a.py.3]
10564+
from typing_extensions import deprecated
10565+
@deprecated("use f2 instead")
10566+
def f() -> None: ...
10567+
10568+
[file a.py.4]
10569+
from typing_extensions import deprecated
10570+
@deprecated("use f3 instead")
10571+
def f() -> None: ...
10572+
10573+
[file a.py.5]
10574+
def f() -> None: ...
10575+
10576+
[builtins fixtures/tuple.pyi]
10577+
[out]
10578+
==
10579+
main:1: note: function a.f is deprecated: use f2 instead
10580+
main:4: note: function a.f is deprecated: use f2 instead
10581+
==
10582+
main:1: note: function a.f is deprecated: use f2 instead
10583+
main:4: note: function a.f is deprecated: use f2 instead
10584+
==
10585+
main:1: note: function a.f is deprecated: use f3 instead
10586+
main:4: note: function a.f is deprecated: use f3 instead
10587+
==
10588+
10589+
10590+
[case testRemoveFunctionDeprecation]
10591+
from a import f
10592+
f()
10593+
import a
10594+
a.f()
10595+
10596+
[file a.py]
10597+
from typing_extensions import deprecated
10598+
@deprecated("use f2 instead")
10599+
def f() -> None: ...
10600+
10601+
[file a.py.2]
10602+
def f() -> None: ...
10603+
10604+
[builtins fixtures/tuple.pyi]
10605+
[out]
10606+
main:1: note: function a.f is deprecated: use f2 instead
10607+
main:4: note: function a.f is deprecated: use f2 instead
10608+
==
10609+
10610+
[case testKeepFunctionDeprecation]
10611+
from a import f
10612+
f()
10613+
import a
10614+
a.f()
10615+
10616+
[file a.py]
10617+
from typing_extensions import deprecated
10618+
@deprecated("use f2 instead")
10619+
def f() -> None: ...
10620+
10621+
[file a.py.2]
10622+
from typing_extensions import deprecated
10623+
@deprecated("use f2 instead")
10624+
def f() -> None: ...
10625+
10626+
[builtins fixtures/tuple.pyi]
10627+
[out]
10628+
main:1: note: function a.f is deprecated: use f2 instead
10629+
main:4: note: function a.f is deprecated: use f2 instead
10630+
==
10631+
main:1: note: function a.f is deprecated: use f2 instead
10632+
main:4: note: function a.f is deprecated: use f2 instead
10633+
10634+
10635+
[case testAddFunctionDeprecationIndirectImport1-only_when_nocache]
10636+
from b import f
10637+
f()
10638+
import b
10639+
b.f()
10640+
10641+
[file b.py]
10642+
from a import f
10643+
10644+
[file a.py]
10645+
def f() -> int: ...
10646+
10647+
[file a.py.2]
10648+
from typing_extensions import deprecated
10649+
@deprecated("use f2 instead")
10650+
def f() -> int: ...
10651+
10652+
10653+
[builtins fixtures/tuple.pyi]
10654+
[out]
10655+
==
10656+
main:1: note: function a.f is deprecated: use f2 instead
10657+
main:4: note: function a.f is deprecated: use f2 instead
10658+
b.py:1: note: function a.f is deprecated: use f2 instead
10659+
10660+
[case testAddFunctionDeprecationIndirectImport2-only_when_cache]
10661+
from b import f
10662+
f()
10663+
import b
10664+
b.f()
10665+
10666+
[file b.py]
10667+
from a import f
10668+
10669+
[file a.py]
10670+
def f() -> int: ...
10671+
10672+
[file a.py.2]
10673+
from typing_extensions import deprecated
10674+
@deprecated("use f2 instead")
10675+
def f() -> int: ...
10676+
10677+
10678+
[builtins fixtures/tuple.pyi]
10679+
[out]
10680+
==
10681+
b.py:1: note: function a.f is deprecated: use f2 instead
10682+
main:1: note: function a.f is deprecated: use f2 instead
10683+
main:4: note: function a.f is deprecated: use f2 instead

0 commit comments

Comments
 (0)