summaryrefslogtreecommitdiff
path: root/numpy/testing/_private/utils.py
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2020-06-19 08:46:05 -0500
committerGitHub <noreply@github.com>2020-06-19 07:46:05 -0600
commitf253a7e39204142e3cf82d6beeef1ce22f5500cd (patch)
treee51be0deadd95abe0170066b8c43cdf69acf57cd /numpy/testing/_private/utils.py
parente8c78e09ab38b80b586108dfb4151cbe70c7a694 (diff)
downloadnumpy-f253a7e39204142e3cf82d6beeef1ce22f5500cd.tar.gz
TST: Add new tests for array coercion (#16571)
* ENH: Add traceback-skip to `assert_array_compare` * TST: Add tests for arraycoercion These tests have many xfails (some technically maybe not correct), which describe in detail what will change when merging the array-coercion changes; since all of those xfails are going to be removed. * TST: Add test for empty sequences * TST: Add tests for bad self-mutating sequence inputs to np.array These should never happen and rightly should lead to undefined behaviour (and preferably errors), but they excercise some more tricky code branches and should probably not crash. * Simplify the "all scalars" logic (hardcode) and fix complex cases * MAINT: Some cleanup, and xfail pypy PyPy seems to have issues with int(numpy_complex), maybe because it gives a warning during conversion (python does not define it). So simply mark it as xfail, it should work in my branch. Also some smaller cleanups. * TST: Add some further test, re-add missing rational * MAINT: Make rationals optional, because they fail some tests currently The failures will go away, since this must again be related to implemetning int() and float(). * Update numpy/conftest.py * MAINT: Fix strings and use pytest.param to clean things up * TST: Add tests for 0-D array-like input to np.array() corner-cases * TST: Improve parameterization IDs to get better printing at -vv
Diffstat (limited to 'numpy/testing/_private/utils.py')
-rw-r--r--numpy/testing/_private/utils.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/numpy/testing/_private/utils.py b/numpy/testing/_private/utils.py
index ef623255b..3827b7505 100644
--- a/numpy/testing/_private/utils.py
+++ b/numpy/testing/_private/utils.py
@@ -719,6 +719,8 @@ def assert_array_compare(comparison, x, y, err_msg='', verbose=True,
at the same locations.
"""
+ __tracebackhide__ = True # Hide traceback for py.test
+
x_id = func(x)
y_id = func(y)
# We include work-arounds here to handle three types of slightly