Test that we remove 'collections.abc' from type signatures.
+
+
+
+
+
+
+
1"""Test that we remove 'collections.abc' from type signatures."""
+ 2
+ 3fromcollections.abcimportAwaitable
+ 4fromcollections.abcimportContainer
+ 5
+ 6
+ 7deffunc(bar:Awaitable[None])->Awaitable[None]:
+ 8returnbar
+ 9
+10
+11classClass(Container[str]):
+12"""
+13 For subclasses, we currently display the full classname.
+14 Mostly because it's easier, but it also makes a bit more sense here.
+15 """
+16
+17def__contains__(self,item):
+18returnitem=="Bar"
+19
+20
+21var:Container[str]="baz"
+
+
+ class
+ Class(collections.abc.Container[str]):
+
+
+
+
+
+
12classClass(Container[str]):
+13"""
+14 For subclasses, we currently display the full classname.
+15 Mostly because it's easier, but it also makes a bit more sense here.
+16 """
+17
+18def__contains__(self,item):
+19returnitem=="Bar"
+
+
+
+
For subclasses, we currently display the full classname.
+Mostly because it's easier, but it also makes a bit more sense here.
+
+
+
+
+
+
+ var: Container[str] =
+'baz'
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/testdata/collections_abc.py b/test/testdata/collections_abc.py
new file mode 100644
index 00000000..09324ed6
--- /dev/null
+++ b/test/testdata/collections_abc.py
@@ -0,0 +1,21 @@
+"""Test that we remove 'collections.abc' from type signatures."""
+
+from collections.abc import Awaitable
+from collections.abc import Container
+
+
+def func(bar: Awaitable[None]) -> Awaitable[None]:
+ return bar
+
+
+class Class(Container[str]):
+ """
+ For subclasses, we currently display the full classname.
+ Mostly because it's easier, but it also makes a bit more sense here.
+ """
+
+ def __contains__(self, item):
+ return item == "Bar"
+
+
+var: Container[str] = "baz"
diff --git a/test/testdata/collections_abc.txt b/test/testdata/collections_abc.txt
new file mode 100644
index 00000000..df60323e
--- /dev/null
+++ b/test/testdata/collections_abc.txt
@@ -0,0 +1,7 @@
+ Awaitable[None]: ...>
+
+ >
+
+>
\ No newline at end of file