20
20
import weakref
21
21
import pytest
22
22
from contextlib import contextmanager
23
+ from test .support import no_tracing
23
24
24
25
from numpy .compat import pickle
25
26
@@ -5119,6 +5120,8 @@ def test_refcount(self):
5119
5120
5120
5121
5121
5122
class TestResize (object ):
5123
+
5124
+ @no_tracing
5122
5125
def test_basic (self ):
5123
5126
x = np .array ([[1 , 0 , 0 ], [0 , 1 , 0 ], [0 , 0 , 1 ]])
5124
5127
if IS_PYPY :
@@ -5135,6 +5138,7 @@ def test_check_reference(self):
5135
5138
assert_raises (ValueError , x .resize , (5 , 1 ))
5136
5139
del y # avoid pyflakes unused variable warning.
5137
5140
5141
+ @no_tracing
5138
5142
def test_int_shape (self ):
5139
5143
x = np .eye (3 )
5140
5144
if IS_PYPY :
@@ -5168,6 +5172,7 @@ def test_invalid_arguments(self):
5168
5172
assert_raises (TypeError , np .eye (3 ).resize , order = 1 )
5169
5173
assert_raises (TypeError , np .eye (3 ).resize , refcheck = 'hi' )
5170
5174
5175
+ @no_tracing
5171
5176
def test_freeform_shape (self ):
5172
5177
x = np .eye (3 )
5173
5178
if IS_PYPY :
@@ -5176,6 +5181,7 @@ def test_freeform_shape(self):
5176
5181
x .resize (3 , 2 , 1 )
5177
5182
assert_ (x .shape == (3 , 2 , 1 ))
5178
5183
5184
+ @no_tracing
5179
5185
def test_zeros_appended (self ):
5180
5186
x = np .eye (3 )
5181
5187
if IS_PYPY :
@@ -5185,6 +5191,7 @@ def test_zeros_appended(self):
5185
5191
assert_array_equal (x [0 ], np .eye (3 ))
5186
5192
assert_array_equal (x [1 ], np .zeros ((3 , 3 )))
5187
5193
5194
+ @no_tracing
5188
5195
def test_obj_obj (self ):
5189
5196
# check memory is initialized on resize, gh-4857
5190
5197
a = np .ones (10 , dtype = [('k' , object , 2 )])
@@ -7796,6 +7803,7 @@ def test_reshape(self):
7796
7803
d = np .ones (100 )
7797
7804
assert_ (sys .getsizeof (d ) < sys .getsizeof (d .reshape (100 , 1 , 1 ).copy ()))
7798
7805
7806
+ @no_tracing
7799
7807
def test_resize (self ):
7800
7808
d = np .ones (100 )
7801
7809
old = sys .getsizeof (d )
0 commit comments