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
|
From: Andreas Tille <tille@debian.org>
Date: Fri, 28 Mar 2025 17:46:41 +0100
Subject: Skip a test on 32-bit archs to prevent
Last-Update: Wed, 14 Feb 2024 15:47:56 +0100
ValueError: array is too big
---
tests/test_minimizer.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/tests/test_minimizer.py b/tests/test_minimizer.py
index d218688..44a1f9a 100644
--- a/tests/test_minimizer.py
+++ b/tests/test_minimizer.py
@@ -1,9 +1,15 @@
import numpy as np
import pytest
+import platform
from lmfit import Minimizer, Parameters
from lmfit.models import GaussianModel
+# Define a custom marker to skip tests on 32-bit architecture
+skip_on_32bit = pytest.mark.skipif(
+ platform.architecture()[0] == "32bit",
+ reason="Skipping test on 32-bit architecture."
+)
def test_scalar_minimize_neg_value():
x0 = 3.14
@@ -24,6 +30,7 @@ def test_scalar_minimize_neg_value():
assert abs(result.fun - fmin) < ftol
+@skip_on_32bit
@pytest.mark.parametrize('method', ('leastsq', 'least_squares', 'nelder',
'lbfgsb', 'powell', 'cg', 'bfgs', 'brute',
'dual_annealing', 'differential_evolution',
|