summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2019-11-16 21:27:29 -0700
committerGitHub <noreply@github.com>2019-11-16 21:27:29 -0700
commit9aeb7513019954718a3225fbab24bdbb98ca4fd5 (patch)
treec4cb0a71af9b494cfccb3498cd17a1981dee752b
parentb2b45fe9b65db490b84e90fea587c5bb867906eb (diff)
parentf48d2c94f141d3a1ef4ee1108ffcadac62bf71a2 (diff)
downloadnumpy-9aeb7513019954718a3225fbab24bdbb98ca4fd5.tar.gz
Merge pull request #14921 from mattip/coverage-refcount
TST: add no_tracing decorator to refcount-sensitive codepath tests
-rw-r--r--.travis.yml2
-rw-r--r--numpy/core/tests/test_multiarray.py8
-rw-r--r--numpy/core/tests/test_regression.py2
3 files changed, 11 insertions, 1 deletions
diff --git a/.travis.yml b/.travis.yml
index db9cd44b8..5c006cbc0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -58,7 +58,7 @@ matrix:
- python3-dbg
- python3-dev
- python3-setuptools
- - python: 3.6
+ - python: 3.7
env: USE_WHEEL=1 RUN_FULL_TESTS=1 RUN_COVERAGE=1 INSTALL_PICKLE5=1
- python: 3.6
env: USE_SDIST=1
diff --git a/numpy/core/tests/test_multiarray.py b/numpy/core/tests/test_multiarray.py
index 0b604e8b8..218106a63 100644
--- a/numpy/core/tests/test_multiarray.py
+++ b/numpy/core/tests/test_multiarray.py
@@ -20,6 +20,7 @@ import gc
import weakref
import pytest
from contextlib import contextmanager
+from test.support import no_tracing
from numpy.compat import pickle
@@ -5119,6 +5120,8 @@ class TestFlat(object):
class TestResize(object):
+
+ @no_tracing
def test_basic(self):
x = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]])
if IS_PYPY:
@@ -5135,6 +5138,7 @@ class TestResize(object):
assert_raises(ValueError, x.resize, (5, 1))
del y # avoid pyflakes unused variable warning.
+ @no_tracing
def test_int_shape(self):
x = np.eye(3)
if IS_PYPY:
@@ -5168,6 +5172,7 @@ class TestResize(object):
assert_raises(TypeError, np.eye(3).resize, order=1)
assert_raises(TypeError, np.eye(3).resize, refcheck='hi')
+ @no_tracing
def test_freeform_shape(self):
x = np.eye(3)
if IS_PYPY:
@@ -5176,6 +5181,7 @@ class TestResize(object):
x.resize(3, 2, 1)
assert_(x.shape == (3, 2, 1))
+ @no_tracing
def test_zeros_appended(self):
x = np.eye(3)
if IS_PYPY:
@@ -5185,6 +5191,7 @@ class TestResize(object):
assert_array_equal(x[0], np.eye(3))
assert_array_equal(x[1], np.zeros((3, 3)))
+ @no_tracing
def test_obj_obj(self):
# check memory is initialized on resize, gh-4857
a = np.ones(10, dtype=[('k', object, 2)])
@@ -7796,6 +7803,7 @@ if not IS_PYPY:
d = np.ones(100)
assert_(sys.getsizeof(d) < sys.getsizeof(d.reshape(100, 1, 1).copy()))
+ @no_tracing
def test_resize(self):
d = np.ones(100)
old = sys.getsizeof(d)
diff --git a/numpy/core/tests/test_regression.py b/numpy/core/tests/test_regression.py
index c7f242642..d5de0f2b2 100644
--- a/numpy/core/tests/test_regression.py
+++ b/numpy/core/tests/test_regression.py
@@ -17,6 +17,7 @@ from numpy.testing import (
_assert_valid_refcount, HAS_REFCOUNT,
)
from numpy.compat import asbytes, asunicode, long, pickle
+from test.support import no_tracing
try:
RecursionError
@@ -1316,6 +1317,7 @@ class TestRegression(object):
assert_(pickle.loads(
pickle.dumps(test_record, protocol=proto)) == test_record)
+ @no_tracing
def test_blasdot_uninitialized_memory(self):
# Ticket #950
for m in [0, 1, 2]: