Skip to content

Commit 35079af

Browse files
authored
TST: Fix test that uses unininitialized memory (numpy#29232)
Tests should avoid this generally, this one is worse, since it can even fail due to warnings.
1 parent 7a74e12 commit 35079af

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

numpy/_core/tests/test_ufunc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2123,9 +2123,9 @@ class ArrayPriorityMinus1000b(ArrayPriorityBase):
21232123
class ArrayPriorityMinus2000(ArrayPriorityBase):
21242124
__array_priority__ = -2000
21252125

2126-
x = ArrayPriorityMinus1000(2)
2127-
xb = ArrayPriorityMinus1000b(2)
2128-
y = ArrayPriorityMinus2000(2)
2126+
x = np.ones(2).view(ArrayPriorityMinus1000)
2127+
xb = np.ones(2).view(ArrayPriorityMinus1000b)
2128+
y = np.ones(2).view(ArrayPriorityMinus2000)
21292129

21302130
assert np.add(x, y) is ArrayPriorityMinus1000
21312131
assert np.add(y, x) is ArrayPriorityMinus1000

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy