Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:bnavigator:numpy
python-numpy
0001-BUG-Fix-test_impossible_feature_enable-fai...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-BUG-Fix-test_impossible_feature_enable-failing-witho.patch of Package python-numpy
From bf50761dee8f0670542bcdc1fd9bff5cdb0448d4 Mon Sep 17 00:00:00 2001 From: Fabian Vogt <fvogt@suse.de> Date: Thu, 28 Mar 2024 14:39:45 +0100 Subject: [PATCH] BUG: Fix test_impossible_feature_enable failing without BASELINE_FEAT If the build has no baseline features set, the test ended up setting e.g. NPY_ENABLE_CPU_FEATURES="ASIMDHP, None". This actually made the execution succeed, as the warning for decoding "None" overrode the error for the real feature. Fix the error handling there by removing the errorneous "return 0;", add a test for this, and avoid passing "None" by accident. --- numpy/_core/src/common/npy_cpu_features.c | 1 - numpy/_core/tests/test_cpu_features.py | 14 ++++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) Index: numpy-2.0.0rc1/numpy/_core/src/common/npy_cpu_features.c =================================================================== --- numpy-2.0.0rc1.orig/numpy/_core/src/common/npy_cpu_features.c +++ numpy-2.0.0rc1/numpy/_core/src/common/npy_cpu_features.c @@ -325,7 +325,6 @@ npy__cpu_check_env(int disable, const ch ) < 0) { return -1; } - return 0; } #define NOTSUPP_BODY \ Index: numpy-2.0.0rc1/numpy/_core/tests/test_cpu_features.py =================================================================== --- numpy-2.0.0rc1.orig/numpy/_core/tests/test_cpu_features.py +++ numpy-2.0.0rc1/numpy/_core/tests/test_cpu_features.py @@ -311,8 +311,8 @@ if __name__ == "__main__": err_type = "RuntimeError" self._expect_error(msg, err_type) - # Ensure that only the bad feature gets reported - feats = f"{bad_feature}, {self.BASELINE_FEAT}" + # Ensure that it fails even when providing garbage in addition + feats = f"{bad_feature}, Foobar" self.env['NPY_ENABLE_CPU_FEATURES'] = feats msg = ( f"You cannot enable CPU features \\({bad_feature}\\), since they " @@ -320,6 +320,16 @@ if __name__ == "__main__": ) self._expect_error(msg, err_type) + if self.BASELINE_FEAT is not None: + # Ensure that only the bad feature gets reported + feats = f"{bad_feature}, {self.BASELINE_FEAT}" + self.env['NPY_ENABLE_CPU_FEATURES'] = feats + msg = ( + f"You cannot enable CPU features \\({bad_feature}\\), since " + "they are not supported by your machine." + ) + self._expect_error(msg, err_type) + is_linux = sys.platform.startswith('linux') is_cygwin = sys.platform.startswith('cygwin') machine = platform.machine()
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor