From 2d7c0f6e2aa70c5eee53e828ba58c6fcc9b20e2f Mon Sep 17 00:00:00 2001 From: lingsheng Date: Wed, 29 Jul 2020 09:55:20 +0800 Subject: [PATCH] Fix test fail on sqlite 3.30+ --- Skip-test-on-sqlite-3.30+.patch | 60 +++++++++++++++++++++++++++++++++ python-sqlalchemy.spec | 7 +++- 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 Skip-test-on-sqlite-3.30+.patch diff --git a/Skip-test-on-sqlite-3.30+.patch b/Skip-test-on-sqlite-3.30+.patch new file mode 100644 index 0000000..bce2b71 --- /dev/null +++ b/Skip-test-on-sqlite-3.30+.patch @@ -0,0 +1,60 @@ +From 6b5d94da84452b125f6788f0e1472b94a43ffc16 Mon Sep 17 00:00:00 2001 +From: Nils Philippsen +Date: Sat, 2 Nov 2019 17:36:50 -0400 +Subject: [PATCH] Expect ordering NULLs to work and skip nested aggregate tests + on sqlite >= 3.30. + +Fixed test failures which would occur with newer SQLite as of version 3.30 +or greater, due to their addition of nulls ordering syntax as well as new +restrictions on aggregate functions. Pull request courtesy Nils Philippsen. + +Fixes: #4920 +Closes: #4921 +Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4921 +Pull-request-sha: e18534a9045786efdaf4963515222838c62e0300 + +Change-Id: Idb2fc96e23e7cc96cf96f586208c2db561518202 +--- + doc/build/changelog/unreleased_13/4920.rst | 9 +++++++++ + test/requirements.py | 5 +++-- + 2 files changed, 12 insertions(+), 2 deletions(-) + create mode 100644 doc/build/changelog/unreleased_13/4920.rst + +diff --git a/doc/build/changelog/unreleased_13/4920.rst b/doc/build/changelog/unreleased_13/4920.rst +new file mode 100644 +index 0000000000..aabcc570b1 +--- /dev/null ++++ b/doc/build/changelog/unreleased_13/4920.rst +@@ -0,0 +1,9 @@ ++.. change:: ++ :tags: bug, tests ++ :tickets: 4920 ++ ++ Fixed test failures which would occur with newer SQLite as of version 3.30 ++ or greater, due to their addition of nulls ordering syntax as well as new ++ restrictions on aggregate functions. Pull request courtesy Nils Philippsen. ++ ++ +diff --git a/test/requirements.py b/test/requirements.py +index bd6fc8133d..42a24c3a97 100644 +--- a/test/requirements.py ++++ b/test/requirements.py +@@ -774,7 +774,8 @@ def dbapi_lastrowid(self): + @property + def nullsordering(self): + """Target backends that support nulls ordering.""" +- return fails_on_everything_except('postgresql', 'oracle', 'firebird') ++ return fails_on_everything_except("postgresql", "oracle", "firebird", ++ "sqlite >= 3.30.0") + + @property + def reflects_pk_names(self): +@@ -789,7 +790,7 @@ def nested_aggregates(self): + """target database can select an aggregate from a subquery that's + also using an aggregate""" + +- return skip_if(["mssql"]) ++ return skip_if(["mssql", "sqlite"]) + + @property + def array_type(self): diff --git a/python-sqlalchemy.spec b/python-sqlalchemy.spec index b12f4da..c3d3f66 100644 --- a/python-sqlalchemy.spec +++ b/python-sqlalchemy.spec @@ -2,12 +2,14 @@ Name: python-sqlalchemy Version: 1.2.11 -Release: 2 +Release: 3 Summary: SQL toolkit and object relational mapper for Python License: MIT URL: http://www.sqlalchemy.org/ Source0: https://files.pythonhosted.org/packages/source/S/SQLAlchemy/SQLAlchemy-%{version}.tar.gz +Patch0001: Skip-test-on-sqlite-3.30+.patch + BuildRequires: python2-devel >= 2.6 python2-setuptools python2-mock python2-pytest BuildRequires: python3-devel python3-setuptools python3-pytest @@ -87,5 +89,8 @@ PYTHONPATH=. %{__python3} -m pytest test %doc doc examples %changelog +* Wed Jul 29 2020 lingsheng - 1.2.11-3 +- Skip test on sqlite 3.30+ + * Tue Nov 26 2019 yanzhihua - 1.2.11-2 - Package init -- Gitee