-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
needs backportapplied to PRs, indicates that it should be ported to the current bug-fix branchapplied to PRs, indicates that it should be ported to the current bug-fix branchtopic: rewriterelated to the assertion rewrite mechanismrelated to the assertion rewrite mechanismtype: bugproblem that needs to be addressedproblem that needs to be addressed
Description
I am currently testing the following function but find that the function passes the test in the normal Python terminal but fails in a PyTest run. The walrus operator is relatively new and not many people use it. I think that there may be an inconsistency in the execution environment.
import numpy as np
def test_walrus_conversion():
a = np.random.random(16)
assert not np.array_equal(a, a := a.astype(np.uint8))
assert np.all(a == 0)
Metadata
Metadata
Assignees
Labels
needs backportapplied to PRs, indicates that it should be ported to the current bug-fix branchapplied to PRs, indicates that it should be ported to the current bug-fix branchtopic: rewriterelated to the assertion rewrite mechanismrelated to the assertion rewrite mechanismtype: bugproblem that needs to be addressedproblem that needs to be addressed