summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
diff options
context:
space:
mode:
authorFrancesco Andreuzzi <andreuzzi.francesco@gmail.com>2022-05-06 19:08:39 +0200
committerGitHub <noreply@github.com>2022-05-06 19:08:39 +0200
commite3a9e1a4188a27359950029be4d82d87c4a618b2 (patch)
treefc7d9408ab7670edb10ea8cea014a55122ac19b0 /numpy/lib/tests
parente468e6717d03028067a4ab4487724b2fa01b95ac (diff)
downloadnumpy-e3a9e1a4188a27359950029be4d82d87c4a618b2.tar.gz
ENH: Optimize `np.empty` for scalar arguments (#20175)
Optimizes the parsing of shape tuples and integers by avoiding multiple conversions and generally refactoring the code. Closes gh-19010, that parsing a single integer was very slow (due to trying to convert it to a squence twice). Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
Diffstat (limited to 'numpy/lib/tests')
-rw-r--r--numpy/lib/tests/test_format.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/numpy/lib/tests/test_format.py b/numpy/lib/tests/test_format.py
index cf35e1563..581d067de 100644
--- a/numpy/lib/tests/test_format.py
+++ b/numpy/lib/tests/test_format.py
@@ -283,7 +283,7 @@ from io import BytesIO
import numpy as np
from numpy.testing import (
assert_, assert_array_equal, assert_raises, assert_raises_regex,
- assert_warns,
+ assert_warns, IS_PYPY,
)
from numpy.testing._private.utils import requires_memory
from numpy.lib import format
@@ -945,6 +945,8 @@ def test_unicode_field_names(tmpdir):
float, np.dtype({'names': ['c'], 'formats': [np.dtype(int, metadata={})]})
]}), False)
])
+@pytest.mark.skipif(IS_PYPY and sys.implementation.version <= (7, 3, 8),
+ reason="PyPy bug in error formatting")
def test_metadata_dtype(dt, fail):
# gh-14142
arr = np.ones(10, dtype=dt)