8000 Fix test_iter with Python 3.14 beta 1 · data-apis/array-api-strict@4d23298 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4d23298

Browse files
committed
Fix test_iter with Python 3.14 beta 1
In Python 3.14 beta 1, generator expression returned by the __iter__ method needs to be executed to throw the expected TypeError. Fixes: #151
1 parent e25b928 commit 4d23298

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

array_api_strict/tests/test_array_object.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ def test_array_namespace():
637637
pytest.raises(ValueError, lambda: a.__array_namespace__(api_version="2026.12"))
638638

639639
def test_iter():
640-
pytest.raises(TypeError, lambda: iter(asarray(3)))
640+
pytest.raises(TypeError, lambda: next(iter(asarray(3))))
641641
assert list(ones(3)) == [asarray(1.), asarray(1.), asarray(1.)]
642642
assert all_(isinstance(a, Array) for a in iter(ones(3)))
643643
assert all_(a.shape == () for a in iter(ones(3)))

0 commit comments

Comments
 (0)
0