File: 0008-skip-test-shape-on-single-cpu-machines.patch

package info (click to toggle)
tomopy 1.15.3%2Bds1-1
  • links: PTS, VCS
  • area: contrib
  • in suites: forky, sid
  • size: 16,296 kB
  • sloc: cpp: 8,205; ansic: 7,231; python: 6,628; sh: 169; makefile: 70
file content (29 lines) | stat: -rw-r--r-- 1,024 bytes parent folder | download | duplicates (3)
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
From: Santiago Vila <sanvila@debian.org>
Date: Sat, 5 Oct 2024 10:10:55 +0200
Subject: Skip test_shape on single-CPU systems

Last-Update: 2024-10-02
---
 test/test_tomopy/test_util/test_mproc.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/test/test_tomopy/test_util/test_mproc.py b/test/test_tomopy/test_util/test_mproc.py
index 4c93736..c7493f6 100644
--- a/test/test_tomopy/test_util/test_mproc.py
+++ b/test/test_tomopy/test_util/test_mproc.py
@@ -50,6 +50,7 @@ import tomopy.util.mproc as mproc
 import numpy as np
 from numpy.testing import assert_allclose, assert_array_equal
 import unittest
+import os
 
 __author__ = "Doga Gursoy"
 __copyright__ = "Copyright (c) 2015, UChicago Argonne, LLC."
@@ -78,6 +79,7 @@ class TestDistributeJobs(unittest.TestCase):
             nchunk=nchunk)
         assert_array_equal(a, ret)
 
+    @unittest.skipIf(os.cpu_count() == 1, "Skipping test on a single CPU machine")
     def test_shape(self):
         a = np.zeros((2, 4, 8))
         # whole array on single core