Fix test failing on 32bit
Signed-off-by: Nils Philippsen <nils@tiptoe.de>
This commit is contained in:
parent
f0ed3500b7
commit
9e5c98850c
73
0001-Repair-test-in-32bit-python-builds.patch
Normal file
73
0001-Repair-test-in-32bit-python-builds.patch
Normal file
@ -0,0 +1,73 @@
|
||||
From 3d892381996e7ba68ee3bf6d7de40c8414e3812a Mon Sep 17 00:00:00 2001
|
||||
From: Federico Caselli <cfederico87@gmail.com>
|
||||
Date: Sat, 12 Nov 2022 20:15:26 +0100
|
||||
Subject: [PATCH] Repair test in 32bit python builds.
|
||||
|
||||
Change-Id: I8287f3e1a975534c8a01a41c9dcc7e5e9f08bb52
|
||||
(cherry picked from commit 9f4ac8d155f58b59cf314cfbc73195ed51a0c146)
|
||||
---
|
||||
lib/sqlalchemy/testing/requirements.py | 4 ++++
|
||||
lib/sqlalchemy/util/__init__.py | 1 +
|
||||
lib/sqlalchemy/util/compat.py | 1 +
|
||||
test/orm/test_cache_key.py | 6 +++++-
|
||||
4 files changed, 11 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/sqlalchemy/testing/requirements.py b/lib/sqlalchemy/testing/requirements.py
|
||||
index 069ff747d..8cd4c64f2 100644
|
||||
--- a/lib/sqlalchemy/testing/requirements.py
|
||||
+++ b/lib/sqlalchemy/testing/requirements.py
|
||||
@@ -1312,6 +1312,10 @@ class SuiteRequirements(Requirements):
|
||||
lambda: util.cpython, "cPython interpreter needed"
|
||||
)
|
||||
|
||||
+ @property
|
||||
+ def is64bit(self):
|
||||
+ return exclusions.only_if(lambda: util.is64bit, "64bit required")
|
||||
+
|
||||
@property
|
||||
def patch_library(self):
|
||||
def check_lib():
|
||||
diff --git a/lib/sqlalchemy/util/__init__.py b/lib/sqlalchemy/util/__init__.py
|
||||
index d6ce64903..c34f73dca 100644
|
||||
--- a/lib/sqlalchemy/util/__init__.py
|
||||
+++ b/lib/sqlalchemy/util/__init__.py
|
||||
@@ -64,6 +64,7 @@ from .compat import dottedgetter
|
||||
from .compat import has_refcount_gc
|
||||
from .compat import inspect_getfullargspec
|
||||
from .compat import int_types
|
||||
+from .compat import is64bit
|
||||
from .compat import iterbytes
|
||||
from .compat import itertools_filter
|
||||
from .compat import itertools_filterfalse
|
||||
diff --git a/lib/sqlalchemy/util/compat.py b/lib/sqlalchemy/util/compat.py
|
||||
index 2c2a1a77a..2b5a2c0ef 100644
|
||||
--- a/lib/sqlalchemy/util/compat.py
|
||||
+++ b/lib/sqlalchemy/util/compat.py
|
||||
@@ -29,6 +29,7 @@ cpython = platform.python_implementation() == "CPython"
|
||||
win32 = sys.platform.startswith("win")
|
||||
osx = sys.platform.startswith("darwin")
|
||||
arm = "aarch" in platform.machine().lower()
|
||||
+is64bit = platform.architecture()[0] == "64bit"
|
||||
|
||||
has_refcount_gc = bool(cpython)
|
||||
|
||||
diff --git a/test/orm/test_cache_key.py b/test/orm/test_cache_key.py
|
||||
index 169df909e..6720baf02 100644
|
||||
--- a/test/orm/test_cache_key.py
|
||||
+++ b/test/orm/test_cache_key.py
|
||||
@@ -1087,7 +1087,11 @@ class EmbeddedSubqTest(_RemoveListeners, DeclarativeMappedTest):
|
||||
"concrete": True,
|
||||
}
|
||||
|
||||
- @testing.combinations("tuples", "memory", argnames="assert_on")
|
||||
+ Base.registry.configure()
|
||||
+
|
||||
+ @testing.combinations(
|
||||
+ "tuples", ("memory", testing.requires.is64bit), argnames="assert_on"
|
||||
+ )
|
||||
def test_cache_key_gen(self, assert_on):
|
||||
Employee = self.classes.Employee
|
||||
|
||||
--
|
||||
2.38.1
|
||||
|
@ -31,6 +31,8 @@ Summary: Modular and flexible ORM library for Python
|
||||
License: MIT
|
||||
URL: https://www.sqlalchemy.org/
|
||||
Source0: %{pypi_source %{srcname} %{srcversion}}
|
||||
# Upstream fix for failing test
|
||||
Patch0: 0001-Repair-test-in-32bit-python-builds.patch
|
||||
|
||||
BuildRequires: gcc
|
||||
BuildRequires: python3-devel >= 3.6
|
||||
@ -74,7 +76,7 @@ Documentation for SQLAlchemy.
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q -n %{srcname}-%{srcversion}
|
||||
%autosetup -n %{srcname}-%{srcversion} -p1
|
||||
|
||||
%build
|
||||
%py3_build
|
||||
|
Loading…
Reference in New Issue
Block a user