Skip to content
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

skip tests that are unreliable on 32-bit platforms by default #1729

Merged
merged 1 commit into from
Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyFAI/test/test_csr.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def test_2d_splitbbox(self):
self.assertTrue(numpy.allclose(res_csr[4].T, res_scipy.normalization), "count is same as normalization")
self.assertTrue(numpy.allclose(res_csr[3].T, res_scipy.signal), "sum_data is almost the same")

@unittest.skipIf(UtilsTest.low_mem, "test unreliable on 32bits processor")
@unittest.skipIf(UtilsTest.TEST_IS32_BIT, "test unreliable on 32bits processor")
def test_2d_nosplit(self):
self.ai.reset()
result_histo = self.ai.integrate2d(self.data, self.N, unit="2th_deg", method="histogram")
Expand Down
4 changes: 2 additions & 2 deletions pyFAI/test/test_histogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def test_count_cython(self):
self.assertTrue(delta == 0, msg="check all pixels were counted")
self.assertTrue(v < self.epsilon, msg="checks delta is lower than %s" % self.epsilon)

@unittest.skipIf(UtilsTest.low_mem, "test unreliable on 32bits processor")
@unittest.skipIf(UtilsTest.TEST_IS32_BIT, "test unreliable on 32bits processor")
def test_count_csr(self):
"""
Test that the pixel count and the total intensity is conserved
Expand All @@ -339,7 +339,7 @@ def test_count_csr(self):
self.assertTrue(delta == 0, msg="check all pixels were counted")
self.assertTrue(v < self.epsilon, msg="checks delta is lower than %s" % self.epsilon)

@unittest.skipIf(UtilsTest.low_mem, "test unreliable on 32bits processor")
@unittest.skipIf(UtilsTest.TEST_IS32_BIT, "test unreliable on 32bits processor")
def test_numpy_vs_cython_vs_csr_2d(self):
"""
Compare numpy histogram with cython simple implementation
Expand Down
7 changes: 7 additions & 0 deletions pyFAI/test/utilstest.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import tempfile
import getpass
import functools
import struct

from silx.resources import ExternalResources
from ..directories import testimages
Expand Down Expand Up @@ -83,6 +84,9 @@ def __init__(self):
self.TEST_LOW_MEM = False
"""Skip tests using too much memory"""

self.TEST_IS32_BIT = False
"""Skip tests on 32-bit systems"""

self.options = None
self.timeout = 60 # timeout in seconds for downloading images
# url_base = "http://forge.epn-campus.eu/attachments/download"
Expand Down Expand Up @@ -167,6 +171,9 @@ def configure(self, parsed_options=None):
elif os.environ.get('PYFAI_LOW_MEM', 'True') == 'False':
self.TEST_LOW_MEM = True

if struct.calcsize("P") == 4:
self.TEST_IS32_BIT = True

def add_parser_argument(self, parser):
"""Add extrat arguments to the test argument parser

Expand Down