File: Ignore-all-divide-by-zero-and-all-nan-warnings.patch

package info (click to toggle)
sunpy 7.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,208 kB
  • sloc: python: 40,753; ansic: 1,710; makefile: 36
file content (43 lines) | stat: -rw-r--r-- 2,028 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From: Ole Streicher <olebole@debian.org>
Date: Tue, 13 Dec 2022 17:44:26 +0100
Subject: Ignore all divide-by-zero and all-nan warnings

---
 pytest.ini                      | 7 +++++++
 sunpy/map/tests/test_mapbase.py | 5 ++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/pytest.ini b/pytest.ini
index b912467..3624f27 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -51,6 +51,13 @@ filterwarnings =
     ignore::DeprecationWarning
     # Do not fail on pytest config issues (i.e. missing plugins) but do show them
     always::pytest.PytestConfigWarning
+    # Ignore all divide-by-zero and all-nan warnings
+    ignore:invalid value encountered in *:RuntimeWarning
+    ignore:divide by zero encountered in *:RuntimeWarning
+    ignore:All-NaN slice encountered:RuntimeWarning
+    ignore:No contour levels were found within the data range:UserWarning
+    ignore:h5py is running against HDF5 1.10:UserWarning
+    ignore:.*pandas is buggy:UserWarning
     # A list of warnings to ignore follows. If you add to this list, you MUST
     # add a comment or ideally a link to an issue that explains why the warning
     # is being ignored
diff --git a/sunpy/map/tests/test_mapbase.py b/sunpy/map/tests/test_mapbase.py
index 9b7d5ad..724c8ad 100644
--- a/sunpy/map/tests/test_mapbase.py
+++ b/sunpy/map/tests/test_mapbase.py
@@ -1801,9 +1801,8 @@ def test_map_arithmetic_multiplication_division(aia171_test_map, value):
     check_arithmetic_value_and_units(new_map, value * aia171_test_map.quantity)
     new_map = aia171_test_map / value
     check_arithmetic_value_and_units(new_map, aia171_test_map.quantity / value)
-    with pytest.warns(RuntimeWarning, match='divide by zero encountered in'):  # NOQA: PT031
-        new_map = value / aia171_test_map
-        check_arithmetic_value_and_units(new_map, value / aia171_test_map.quantity)
+    new_map = value / aia171_test_map
+    check_arithmetic_value_and_units(new_map, value / aia171_test_map.quantity)
 
 
 def test_map_arithmetic_pow(aia171_test_map):