Closed
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)