-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
TST: mask DeprecationWarning in xfailed test #15610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@r-devulap this is failing with |
@mattip what deprecation warning is this giving? I do not quite understand. Clip used to include a deprecation warning, which should never be hit. But that is now even moved the dtype creation phase, so what is going on? |
hmm this is little bizarre. I can't reproduce this error locally on the manylinux2010 docker despite running 10,000 times and it doesn't seem like it fails on the CI consistently too. Reciprocal function is just a divide and should produce exactly the same result no matter what SIMD variant it uses (including the scalar code). There should be no ULP error. |
@r-devulap the process to run the test builds a wheel with a manylinux2010 docker and tests with the If you want to reproduce the exact process the build follows, you can use
```
# Once off, modify the numpy-wheel repo
# Add the following to `config.sh` to use the current state of
# the numpy submodule, otherwise it uses the git commit in
# `build_commit`
function clean_code {
echo skipping git update
}
# Make the following changes to multibuild
diff --git a/docker_test_wrap.sh b/docker_test_wrap.sh
index a37b7e0..7305252 100755
--- a/docker_test_wrap.sh
+++ b/docker_test_wrap.sh
@@ -1,6 +1,7 @@
#!/bin/bash
# Install and test steps on Linux
-set -e
+set -ex
+export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
Get needed utilitiesMULTIBUILD_DIR=$(dirname "${BASH_SOURCE[0]}") install_runset -e -MANYLINUX_URL=${MANYLINUX_URL:-https://5cf40426d9f06eb7461d-6fe47d9331aba7cd62fc36c7196769e4.ssl.cf2.rackcdn.com} Default Manylinux versionWarning: ignored if DOCKER_IMAGE variable is set.@@ -19,7 +18,7 @@ MANYLINUX_URL=${MANYLINUX_URL:-https://5cf40426d9f06eb7461d-6fe47d9331aba7cd62fc Get our own location on this filesystem-MULTIBUILD_DIR=$(dirname "${BASH_SOURCE[0]}") Allow travis Python version as proxy for multibuild Python versionMB_PYTHON_VERSION=${MB_PYTHON_VERSION:-$TRAVIS_PYTHON_VERSION}
cd numpy-wheel set -x this uses a manylinux2010 docker to build the wheelbuild_wheel $repo_dir $plat This uses the other docker to install and test the wheelinstall_run $plat
|
@seberg I convinced myself by adding a |
Sorry matti, nvm. I was confused, because I checked a non-development version and thought there was no datetime/timedelta loop for |
Please wait until gh-15615 is settled before merging this, the CI failure here is interesting and difficult to reproduce, and I think merging it will make the log dissapear. |
numpy/core/tests/test_numeric.py
Outdated
@@ -2018,7 +2018,8 @@ def test_NaT_propagation(self, arr, amin, amax): | |||
# NOTE: the expected function spec doesn't | |||
# propagate NaT, but clip() now does | |||
expected = np.minimum(np.maximum(arr, amin), amax) | |||
actual = np.clip(arr, amin, amax) | |||
with assert_warns(DeprecationWarning): | |||
actual = np.clip(arr, amin, amax) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about @pytest.mark.filterwarnings("ignore::DeprecationWarning")
? Using assert_warns seems out of place for something that will be changed in the future, tests for warnings belong in test_deprecations
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Another option is to delete this test: I think it started out as an edge case reported by hypothesis, and has now both an xfail and a warning filter.
08b51ba
to
5b4dabe
Compare
5b4dabe
to
10bba3c
Compare
Thanks Matti. |
xfailed tests are still run, they are expect to raise. This one was also emitting a DeprecationWarning, which is confusing