Accepting request 853620 from devel:languages:python
- Add skip_32bit_tests.patch (gh#MagicStack/immutables#53) to skip tests which fail on 32bit architectures. OBS-URL: https://build.opensuse.org/request/show/853620 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-immutables?expand=0&rev=5
This commit is contained in:
commit
744e58b0c7
@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Dec 7 15:34:37 UTC 2020 - Matej Cepl <mcepl@suse.com>
|
||||||
|
|
||||||
|
- Add skip_32bit_tests.patch (gh#MagicStack/immutables#53) to skip tests
|
||||||
|
which fail on 32bit architectures.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Oct 13 07:42:13 UTC 2020 - Dirk Mueller <dmueller@suse.com>
|
Tue Oct 13 07:42:13 UTC 2020 - Dirk Mueller <dmueller@suse.com>
|
||||||
|
|
||||||
|
@ -25,6 +25,9 @@ Summary: Immutable collections for Python
|
|||||||
License: Apache-2.0
|
License: Apache-2.0
|
||||||
URL: https://github.com/MagicStack/immutables
|
URL: https://github.com/MagicStack/immutables
|
||||||
Source: https://files.pythonhosted.org/packages/source/i/immutables/immutables-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/i/immutables/immutables-%{version}.tar.gz
|
||||||
|
# PATCH-FIX-UPSTREAM skip_32bit_tests.patch gh#MagicStack/immutables#53 mcepl@suse.com
|
||||||
|
# skip failing tests on 32bit architectures
|
||||||
|
Patch0: skip_32bit_tests.patch
|
||||||
BuildRequires: %{python_module devel}
|
BuildRequires: %{python_module devel}
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module setuptools}
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
@ -35,7 +38,8 @@ BuildRequires: python-rpm-macros
|
|||||||
Immutable collections for Python.
|
Immutable collections for Python.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n immutables-%{version}
|
%autosetup -p1 -n immutables-%{version}
|
||||||
|
|
||||||
sed -i 's/\.system//' setup.py
|
sed -i 's/\.system//' setup.py
|
||||||
|
|
||||||
%build
|
%build
|
||||||
@ -49,12 +53,7 @@ export CFLAGS="%{optflags}"
|
|||||||
}
|
}
|
||||||
|
|
||||||
%check
|
%check
|
||||||
# Fails on 32bit for some reason
|
%pyunittest discover -v
|
||||||
%ifarch %ix86
|
|
||||||
rm -v tests/test_none_keys.py
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%python_exec setup.py test
|
|
||||||
|
|
||||||
%files %{python_files}
|
%files %{python_files}
|
||||||
%doc README.rst
|
%doc README.rst
|
||||||
|
23
skip_32bit_tests.patch
Normal file
23
skip_32bit_tests.patch
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
--- a/tests/test_none_keys.py
|
||||||
|
+++ b/tests/test_none_keys.py
|
||||||
|
@@ -1,8 +1,10 @@
|
||||||
|
+import sys
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
from immutables.map import map_hash, map_mask, Map as PyMap
|
||||||
|
-from immutables._testutils import * # NoQA
|
||||||
|
+from immutables._testutils import HashKey # NoQA
|
||||||
|
|
||||||
|
+is_32bits = sys.maxsize <= 2**32 # 32bit-dness
|
||||||
|
|
||||||
|
none_hash = map_hash(None)
|
||||||
|
assert(none_hash != 1)
|
||||||
|
@@ -35,6 +37,8 @@ class NoneCollision(HashKey):
|
||||||
|
class BaseNoneTest:
|
||||||
|
Map = None
|
||||||
|
|
||||||
|
+ @unittest.skipIf(is_32bits,
|
||||||
|
+ "fail on 32bit arch, gh#MagicStack/immutables#53")
|
||||||
|
def test_none_collisions(self):
|
||||||
|
collisions = [NoneCollision('a', level) for level in range(7)]
|
||||||
|
indices = [map_mask(none_hash, shift) for shift in range(0, 32, 5)]
|
Loading…
Reference in New Issue
Block a user