Skip to content

Test failure with Python 3.14 beta 1 #151

Closed
@frenzymadness

Description

@frenzymadness

According to this record in the changelog of Python 3.14 beta 1:

gh-127682: No longer call iter twice when creating and executing a generator expression. Creating a generator expression from a non-interable will raise only when the generator expression is executed. This brings the behavior of generator expressions in line with other generators.

the expected exception in:

pytest.raises(TypeError, lambda: iter(asarray(3)))

is not gonna be raised until the generator returned from the __iter__ method of Array object is accessed. Adding next(…) around the iter(…) call makes the test compatible with both 3.14b1 and older Pythons.

I'm testing this with older version of the package so I'm sorry if it's no longer relevant. I see the __iter__ code is slightly different in the latest version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions