summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf Gommers <ralf.gommers@gmail.com>2021-03-13 10:23:06 +0100
committerGitHub <noreply@github.com>2021-03-13 10:23:06 +0100
commit02cc19271286c9b1ac53e71e11e0678ecde89c86 (patch)
treefb38002ab6f8f940c27edb15832deb14f052a561
parente03a557b3160b08cc5ad1f7469036b0100cd6f67 (diff)
parentabf593e91023aca8f1efbd74581a754cdeaf3593 (diff)
downloadnumpy-02cc19271286c9b1ac53e71e11e0678ecde89c86.tar.gz
Merge pull request #18437 from seberg/no-caches-and-fixes
TST: Fix some uninitialized memory in the tests
-rw-r--r--numpy/core/tests/test_regression.py3
-rw-r--r--numpy/core/tests/test_umath.py2
2 files changed, 3 insertions, 2 deletions
diff --git a/numpy/core/tests/test_regression.py b/numpy/core/tests/test_regression.py
index 5faa9923c..099293307 100644
--- a/numpy/core/tests/test_regression.py
+++ b/numpy/core/tests/test_regression.py
@@ -2104,7 +2104,8 @@ class TestRegression:
assert_raises(TypeError, np.searchsorted, a, 1.2)
# Ticket #2066, similar problem:
dtype = np.format_parser(['i4', 'i4'], [], [])
- a = np.recarray((2, ), dtype)
+ a = np.recarray((2,), dtype)
+ a[...] = [(1, 2), (3, 4)]
assert_raises(TypeError, np.searchsorted, a, 1)
def test_complex64_alignment(self):
diff --git a/numpy/core/tests/test_umath.py b/numpy/core/tests/test_umath.py
index bc72aa862..2249c866c 100644
--- a/numpy/core/tests/test_umath.py
+++ b/numpy/core/tests/test_umath.py
@@ -1952,7 +1952,7 @@ class TestSpecialMethods:
_wrap_args = None
_prepare_args = None
def __new__(cls):
- return np.empty(()).view(cls)
+ return np.zeros(()).view(cls)
def __array_wrap__(self, obj, context):
self._wrap_args = context[1]
return obj