diff --git a/tests/basics/getitem.py b/tests/basics/getitem.py
index <HASH>..<HASH> 100644
--- a/tests/basics/getitem.py
+++ b/tests/basics/getitem.py
@@ -21,6 +21,12 @@ try:
 except StopIteration:
     pass
 
+# this class raises an IndexError to stop the iteration
+class A:
+    def __getitem__(self, i):
+        raise IndexError
+print(list(A()))
+
 # this class raises a non-StopIteration exception on iteration
 class A:
     def __getitem__(self, i):
tests: Add test where __getitem__ raises IndexError to stop iteration.