summaryrefslogtreecommitdiff
path: root/tests/functional/u
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional/u')
-rw-r--r--tests/functional/u/unnecessary/unnecessary_dunder_call_async_py310.py15
-rw-r--r--tests/functional/u/unnecessary/unnecessary_dunder_call_async_py310.rc2
-rw-r--r--tests/functional/u/unnecessary/unnecessary_dunder_call_async_py310.txt2
-rw-r--r--tests/functional/u/unnecessary/unnecessary_dunder_call_async_py39.py15
-rw-r--r--tests/functional/u/unnecessary/unnecessary_dunder_call_async_py39.rc2
5 files changed, 36 insertions, 0 deletions
diff --git a/tests/functional/u/unnecessary/unnecessary_dunder_call_async_py310.py b/tests/functional/u/unnecessary/unnecessary_dunder_call_async_py310.py
new file mode 100644
index 000000000..c2ab58a57
--- /dev/null
+++ b/tests/functional/u/unnecessary/unnecessary_dunder_call_async_py310.py
@@ -0,0 +1,15 @@
+"""Checks for unnecessary-dunder-call on __aiter__/__anext__ with py-version=3.10."""
+
+
+class MyClass:
+ """A class implementing __aiter__ and __anext__."""
+
+ def __aiter__(self):
+ ...
+
+ async def __anext__(self):
+ ...
+
+
+MyClass().__aiter__() # [unnecessary-dunder-call]
+MyClass().__anext__() # [unnecessary-dunder-call]
diff --git a/tests/functional/u/unnecessary/unnecessary_dunder_call_async_py310.rc b/tests/functional/u/unnecessary/unnecessary_dunder_call_async_py310.rc
new file mode 100644
index 000000000..7d7b7aa0c
--- /dev/null
+++ b/tests/functional/u/unnecessary/unnecessary_dunder_call_async_py310.rc
@@ -0,0 +1,2 @@
+[master]
+py-version=3.10
diff --git a/tests/functional/u/unnecessary/unnecessary_dunder_call_async_py310.txt b/tests/functional/u/unnecessary/unnecessary_dunder_call_async_py310.txt
new file mode 100644
index 000000000..bcb5647f9
--- /dev/null
+++ b/tests/functional/u/unnecessary/unnecessary_dunder_call_async_py310.txt
@@ -0,0 +1,2 @@
+unnecessary-dunder-call:14:0:14:21::Unnecessarily calls dunder method __aiter__. Use aiter built-in function.:HIGH
+unnecessary-dunder-call:15:0:15:21::Unnecessarily calls dunder method __anext__. Use anext built-in function.:HIGH
diff --git a/tests/functional/u/unnecessary/unnecessary_dunder_call_async_py39.py b/tests/functional/u/unnecessary/unnecessary_dunder_call_async_py39.py
new file mode 100644
index 000000000..589524170
--- /dev/null
+++ b/tests/functional/u/unnecessary/unnecessary_dunder_call_async_py39.py
@@ -0,0 +1,15 @@
+"""Checks for unnecessary-dunder-call on __aiter__/__anext__ with py-version=3.9."""
+
+
+class MyClass:
+ """A class implementing __aiter__ and __anext__."""
+
+ def __aiter__(self):
+ ...
+
+ async def __anext__(self):
+ ...
+
+
+MyClass().__aiter__()
+MyClass().__anext__()
diff --git a/tests/functional/u/unnecessary/unnecessary_dunder_call_async_py39.rc b/tests/functional/u/unnecessary/unnecessary_dunder_call_async_py39.rc
new file mode 100644
index 000000000..aed012f73
--- /dev/null
+++ b/tests/functional/u/unnecessary/unnecessary_dunder_call_async_py39.rc
@@ -0,0 +1,2 @@
+[MAIN]
+py-version=3.9