-
Notifications
You must be signed in to change notification settings - Fork 23
Handling warnings in pytest #1845
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
View rendered docs @ https://intelpython.github.io/dpnp/index.html |
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.
pytest -s
run on Gen9 reports 255 warnings:
=================================================================================================================================== warnings summary ===================================================================================================================================
tests/test_arraycreation.py: 250 warnings
/localdisk/work/antonvol/soft/miniconda3/envs/dpnp_py39_ext/lib/python3.9/site-packages/dpctl/tensor/_type_utils.py:456: DeprecationWarning: finfo() dtype cannot be None. This behavior will raise an error in the future. (Deprecated in NumPy 1.25)
self._finfo = np.finfo(dtype)
tests/test_sycl_queue.py::test_from_dlpack_with_dpt[complex64-level_zero:gpu:0]
/localdisk/work/antonvol/soft/miniconda3/envs/dpnp_py39_ext/lib/python3.9/site-packages/numpy/testing/_private/utils.py:722: RuntimeWarning: invalid value encountered in equal
func=lambda xy: xy == +inf,
tests/test_sycl_queue.py::test_from_dlpack_with_dpt[complex64-level_zero:gpu:0]
/localdisk/work/antonvol/soft/miniconda3/envs/dpnp_py39_ext/lib/python3.9/site-packages/numpy/testing/_private/utils.py:725: RuntimeWarning: invalid value encountered in equal
func=lambda xy: xy == -inf,
tests/third_party/cupy/core_tests/test_ndarray_math.py::TestRoundHalfway_param_0_{decimals=-3}::test_round_halfway_uint
/localdisk/work/antonvol/soft/miniconda3/envs/dpnp_py39_ext/lib/python3.9/site-packages/dpctl/tensor/_ctors.py:646: DeprecationWarning: NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays. The conversion of 1000 to uint8 will fail in the future.
For the old behavior, usually:
np.array(value).astype(dtype)
will give the desired result (the cast overflows).
np.asarray(obj, dtype=dtype),
tests/third_party/cupy/core_tests/test_ndarray_math.py::TestRoundHalfway_param_0_{decimals=-3}::test_round_halfway_uint
/localdisk/work/antonvol/code/dpnp/tests/third_party/cupy/core_tests/test_ndarray_math.py:108: DeprecationWarning: NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays. The conversion of 1000 to uint8 will fail in the future.
For the old behavior, usually:
np.array(value).astype(dtype)
will give the desired result (the cast overflows).
a *= xp.array(scale, dtype=dtype)
tests/third_party/cupy/creation_tests/test_ranges.py::TestRanges::test_linspace_float_underflow
/localdisk/work/antonvol/soft/miniconda3/envs/dpnp_py39_ext/lib/python3.9/site-packages/numpy/core/function_base.py:158: RuntimeWarning: overflow encountered in multiply
y *= step
Is it expected to have warning on Gen9?
There are still warnings on PVC: =========================================================================================== warnings summary ===========================================================================================
tests/test_sycl_queue.py::test_from_dlpack_with_dpt[complex64-level_zero:gpu:0]
tests/test_sycl_queue.py::test_from_dlpack_with_dpt[complex64-level_zero:gpu:1]
/home/gta/miniconda3/envs/dpnp_dev/lib/python3.10/site-packages/numpy/testing/_private/utils.py:722: RuntimeWarning: invalid value encountered in equal
func=lambda xy: xy == +inf,
tests/test_sycl_queue.py::test_from_dlpack_with_dpt[complex64-level_zero:gpu:0]
tests/test_sycl_queue.py::test_from_dlpack_with_dpt[complex64-level_zero:gpu:1]
/home/gta/miniconda3/envs/dpnp_dev/lib/python3.10/site-packages/numpy/testing/_private/utils.py:725: RuntimeWarning: invalid value encountered in equal
func=lambda xy: xy == -inf,
|
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.
Thank you @vlad-perevezentsev
* Enable loading of warning plugin in pytest * Fix DeprecationWarning in test_histogram.py * Ignore DeprecationWarning for pkg_resources * Fix SyntaxWarning in test_ndarray_math.py * Deprecate numpy_cupy_array_list_equal * Fix DeprecationWarning in test_mathematical.py * Avoid FutureWarning for rcond parameter of numpy.linalg.lstsq * Fix DeprecationWarning in cupy test_elementwise.py * Skip test_msort_zero_dim - not implemented * Ignore RuntimeWarning for numpy.arccosh * Fix DeprecationWarning for numpy.fromstring * Add test_digitize_inf to TestDigitize * Fix DeprecationWarning: Converting np.integer to a dtype is deprecated * Fix ComplexWarning in 2 ways * Fix RuntimeWarning by reducing shape in TestNansumNanprodLong * Handle DeprecationWarning in test_dparray.py * Skip test_lexsort_one_dim/_two_dim - not implemented * Handle RuntimeWarning in test_linspace_float_underflow * Fix DeprecationWarning in test_round_halfway_uint * Update test_linspace to avoid DeprecationWarning * Use pytest.mark.usefixtures('suppress_complex_warning') * Handle RuntimeWarning: divide by zero in test_reciprocal * Fix DeprecationWarning in test_mathematical.py * Handle RuntimeWarning in test_from_dlpack * Add the fixture to test_from_dlpack_with_dpt insted of test_from_dlpack 6a737c4
This PR suggests getting rid of use
-p warnings
flag in pytest configuration and handling warnings separately.This will help you see new warnings in internal CI logs and during development