File: 1101839_test_crash.patch

package info (click to toggle)
python-nxtomomill 1.1.0-6
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,588 kB
  • sloc: python: 15,974; makefile: 13; sh: 3
file content (31 lines) | stat: -rw-r--r-- 1,326 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
Description: Don't initialize tqdm in pytest.parametrize

because, as described in the bug, it may crash on exit

Author: Emmanuel Arias, Rebecca N. Palmer <rebecca_palmer@zoho.com>
Bug-Debian: https://bugs.debian.org/1101839
Forwarded: no

--- a/nxtomomill/converter/edf/tests/test_edf2nx.py
+++ b/nxtomomill/converter/edf/tests/test_edf2nx.py
@@ -27,12 +27,18 @@ from nxtomomill.converter.edf.edfconvert
     "duplicate_data, external_path_type",
     ((False, "absolute"), (False, "relative"), (True, "absolute")),
 )
-@pytest.mark.parametrize("progress", (None, tqdm(desc="conversion from edf")))
+@pytest.mark.parametrize("has_progress", (False, True))
 @pytest.mark.skipif(
     condition=(version.MINOR < 7 and version.MAJOR == 0),
     reason="dark_n and ref_n from EDFTomoScan where not existing",
 )
-def test_edf_to_nx_converter(progress, duplicate_data, external_path_type):
+def test_edf_to_nx_converter(has_progress, duplicate_data, external_path_type):
+    if has_progress:
+        # This is done here and not in parametrize() to avoid
+        # a crash on exit https://bugs.debian.org/1101839
+        progress = tqdm(desc="conversion from edf")
+    else:
+        progress = None
     with tempfile.TemporaryDirectory() as folder:
         scan_path = os.path.join(folder, "myscan")
         n_proj = 120