diff options
author | Matti Picus <matti.picus@gmail.com> | 2021-07-08 00:22:38 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-08 00:22:38 +0300 |
commit | d78893c1116b3ada9eb1ebbddc17aee69693eb5c (patch) | |
tree | c9fb5c042829925cf01accfe5355d914dd4798d7 /numpy/core | |
parent | 068074f4acab87b0fabf194517b7dfb0f038af5a (diff) | |
parent | 22848046920d58ba91893e003b1a07ed9f763275 (diff) | |
download | numpy-d78893c1116b3ada9eb1ebbddc17aee69693eb5c.tar.gz |
Merge pull request #19423 from Schleehauf/main
Skip finite recursion and refcounting tests for pyston
Diffstat (limited to 'numpy/core')
-rw-r--r-- | numpy/core/tests/test_dtype.py | 9 | ||||
-rw-r--r-- | numpy/core/tests/test_multiarray.py | 6 | ||||
-rw-r--r-- | numpy/core/tests/test_regression.py | 6 |
3 files changed, 17 insertions, 4 deletions
diff --git a/numpy/core/tests/test_dtype.py b/numpy/core/tests/test_dtype.py index 3d15009ea..4f52268f5 100644 --- a/numpy/core/tests/test_dtype.py +++ b/numpy/core/tests/test_dtype.py @@ -9,10 +9,12 @@ import numpy as np from numpy.core._rational_tests import rational from numpy.core._multiarray_tests import create_custom_field_dtype from numpy.testing import ( - assert_, assert_equal, assert_array_equal, assert_raises, HAS_REFCOUNT) + assert_, assert_equal, assert_array_equal, assert_raises, HAS_REFCOUNT, + IS_PYSTON) from numpy.compat import pickle from itertools import permutations + def assert_dtype_equal(a, b): assert_equal(a, b) assert_equal(hash(a), hash(b), @@ -805,12 +807,14 @@ class TestMonsterType: ('yi', np.dtype((a, (3, 2))))]) assert_dtype_equal(c, d) + @pytest.mark.skipif(IS_PYSTON, reason="Pyston disables recursion checking") def test_list_recursion(self): l = list() l.append(('f', l)) with pytest.raises(RecursionError): np.dtype(l) + @pytest.mark.skipif(IS_PYSTON, reason="Pyston disables recursion checking") def test_tuple_recursion(self): d = np.int32 for i in range(100000): @@ -818,6 +822,7 @@ class TestMonsterType: with pytest.raises(RecursionError): np.dtype(d) + @pytest.mark.skipif(IS_PYSTON, reason="Pyston disables recursion checking") def test_dict_recursion(self): d = dict(names=['self'], formats=[None], offsets=[0]) d['formats'][0] = d @@ -1239,6 +1244,7 @@ class TestFromDTypeAttribute: assert np.dtype(dt) == np.float64 assert np.dtype(dt()) == np.float64 + @pytest.mark.skipif(IS_PYSTON, reason="Pyston disables recursion checking") def test_recursion(self): class dt: pass @@ -1262,6 +1268,7 @@ class TestFromDTypeAttribute: np.dtype(dt) np.dtype(dt(1)) + @pytest.mark.skipif(IS_PYSTON, reason="Pyston disables recursion checking") def test_void_subtype_recursion(self): class vdt(np.void): pass diff --git a/numpy/core/tests/test_multiarray.py b/numpy/core/tests/test_multiarray.py index 67e776937..7c8fc8e3e 100644 --- a/numpy/core/tests/test_multiarray.py +++ b/numpy/core/tests/test_multiarray.py @@ -25,8 +25,8 @@ from numpy.core._rational_tests import rational from numpy.testing import ( assert_, assert_raises, assert_warns, assert_equal, assert_almost_equal, assert_array_equal, assert_raises_regex, assert_array_almost_equal, - assert_allclose, IS_PYPY, HAS_REFCOUNT, assert_array_less, runstring, - temppath, suppress_warnings, break_cycles, + assert_allclose, IS_PYPY, IS_PYSTON, HAS_REFCOUNT, assert_array_less, + runstring, temppath, suppress_warnings, break_cycles, ) from numpy.testing._private.utils import _no_tracing from numpy.core.tests._locales import CommaDecimalPointLocale @@ -8113,6 +8113,8 @@ class TestConversion: assert_raises(NotImplementedError, bool, np.array(NotConvertible())) assert_raises(NotImplementedError, bool, np.array([NotConvertible()])) + if IS_PYSTON: + pytest.skip("Pyston disables recursion checking") self_containing = np.array([None]) self_containing[0] = self_containing diff --git a/numpy/core/tests/test_regression.py b/numpy/core/tests/test_regression.py index 312d0683d..21cc8c159 100644 --- a/numpy/core/tests/test_regression.py +++ b/numpy/core/tests/test_regression.py @@ -12,7 +12,7 @@ from numpy.testing import ( assert_, assert_equal, IS_PYPY, assert_almost_equal, assert_array_equal, assert_array_almost_equal, assert_raises, assert_raises_regex, assert_warns, suppress_warnings, - _assert_valid_refcount, HAS_REFCOUNT, + _assert_valid_refcount, HAS_REFCOUNT, IS_PYSTON ) from numpy.testing._private.utils import _no_tracing, requires_memory from numpy.compat import asbytes, asunicode, pickle @@ -22,6 +22,8 @@ try: except NameError: RecursionError = RuntimeError # python < 3.5 + + class TestRegression: def test_invalid_round(self): # Ticket #3 @@ -1796,6 +1798,7 @@ class TestRegression: assert_(a.flags.f_contiguous) assert_(b.flags.c_contiguous) + @pytest.mark.skipif(IS_PYSTON, reason="Pyston disables recursion checking") def test_object_array_self_reference(self): # Object arrays with references to themselves can cause problems a = np.array(0, dtype=object) @@ -1804,6 +1807,7 @@ class TestRegression: assert_raises(RecursionError, float, a) a[()] = None + @pytest.mark.skipif(IS_PYSTON, reason="Pyston disables recursion checking") def test_object_array_circular_reference(self): # Test the same for a circular reference. a = np.array(0, dtype=object) |