Skip to content

Commit 71ab6c6

Browse files
committed
Add an iteration test.
1 parent e638878 commit 71ab6c6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/test_lazy_object_proxy.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -803,6 +803,15 @@ def test_iteration(lazy_object_proxy):
803803

804804
assert result == items
805805

806+
with pytest.raises(TypeError):
807+
for _ in lazy_object_proxy.Proxy(lambda: 1):
808+
pass
809+
810+
811+
def test_iter_builtin(lazy_object_proxy):
812+
iter(lazy_object_proxy.Proxy(lambda: [1, 2]))
813+
pytest.raises(TypeError, iter, lazy_object_proxy.Proxy(lambda: 1))
814+
806815

807816
def test_context_manager(lazy_object_proxy):
808817
class Class(object):

0 commit comments

Comments
 (0)