Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
python3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
certo
python3
Commits
af3980fa
Commit
af3980fa
authored
Aug 23, 2021
by
Vladimir Bashkirtsev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nntp and sqlite tests need fixing
parent
77d58adc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
106 additions
and
0 deletions
+106
-0
Makefile
Makefile
+2
-0
Python-3.8.3-nntp_test_fix.patch
Python-3.8.3-nntp_test_fix.patch
+40
-0
Python-3.8.3-sqlite_test_fix.patch
Python-3.8.3-sqlite_test_fix.patch
+64
-0
No files found.
Makefile
View file @
af3980fa
all
:
tar
xf Python-3.8.3.tar.xz
patch
-Np1
-d
Python-3.8.3 < Python-3.8.3-nntp_test_fix.patch
patch
-Np1
-d
Python-3.8.3 < Python-3.8.3-sqlite_test_fix.patch
cd
Python-3.8.3
&&
./configure
--build
=
$(CLFS_TARGET)
--prefix
=
/usr
--enable-shared
--with-system-expat
--with-system-ffi
--with-ensurepip
=
yes
--enable-optimizations
$(MAKE)
-C
Python-3.8.3
if
[[
!
"
$(BUILD_OPTIONS)
"
=
~ no-tests
]]
;
then
\
...
...
Python-3.8.3-nntp_test_fix.patch
0 → 100644
View file @
af3980fa
diff -uNr Python-3.8.3/Lib/test/test_nntplib.py Python-3.8.3-nntp_test_fix/Lib/test/test_nntplib.py
--- Python-3.8.3/Lib/test/test_nntplib.py 2020-05-14 03:01:54.000000000 +0930
+++ Python-3.8.3-nntp_test_fix/Lib/test/test_nntplib.py 2021-08-23 18:34:21.547699205 +0930
@@ -82,7 +82,7 @@
desc = self.server.description(self.GROUP_NAME)
_check_desc(desc)
# Another sanity check
- self.assertIn("Python", desc)
+ self.assertIn(self.DESC, desc)
# With a pattern
desc = self.server.description(self.GROUP_PAT)
_check_desc(desc)
@@ -299,6 +299,7 @@
NNTP_HOST = 'news.trigofacile.com'
GROUP_NAME = 'fr.comp.lang.python'
GROUP_PAT = 'fr.comp.lang.*'
+ DESC = 'Python'
NNTP_CLASS = NNTP
@@ -332,8 +333,11 @@
# 400 connections per day are accepted from each IP address."
NNTP_HOST = 'nntp.aioe.org'
- GROUP_NAME = 'comp.lang.python'
- GROUP_PAT = 'comp.lang.*'
+ # bpo-42794: aioe.test is one of the official groups on this server
+ # used for testing: https://news.aioe.org/manual/aioe-hierarchy/
+ GROUP_NAME = 'aioe.test'
+ GROUP_PAT = 'aioe.*'
+ DESC = 'test'
NNTP_CLASS = getattr(nntplib, 'NNTP_SSL', None)
diff -uNr Python-3.8.3/Misc/NEWS.d/next/Tests/2021-01-01-08-52-36.bpo-42794.-7-XGz.rst Python-3.8.3-nntp_test_fix/Misc/NEWS.d/next/Tests/2021-01-01-08-52-36.bpo-42794.-7-XGz.rst
--- Python-3.8.3/Misc/NEWS.d/next/Tests/2021-01-01-08-52-36.bpo-42794.-7-XGz.rst 1970-01-01 09:30:00.000000000 +0930
+++ Python-3.8.3-nntp_test_fix/Misc/NEWS.d/next/Tests/2021-01-01-08-52-36.bpo-42794.-7-XGz.rst 2021-08-23 18:34:21.547699205 +0930
@@ -0,0 +1,2 @@
+Update test_nntplib to use offical group name of news.aioe.org for testing.
+Patch by Dong-hee Na.
Python-3.8.3-sqlite_test_fix.patch
0 → 100644
View file @
af3980fa
diff -uNr Python-3.8.3/Lib/sqlite3/test/userfunctions.py Python-3.8.3-sqlite_test_fix/Lib/sqlite3/test/userfunctions.py
--- Python-3.8.3/Lib/sqlite3/test/userfunctions.py 2020-05-14 03:01:54.000000000 +0930
+++ Python-3.8.3-sqlite_test_fix/Lib/sqlite3/test/userfunctions.py 2021-08-23 17:17:16.812492008 +0930
@@ -1,8 +1,7 @@
-#-*- coding: iso-8859-1 -*-
# pysqlite2/test/userfunctions.py: tests for user-defined functions and
# aggregates.
#
-# Copyright (C) 2005-2007 Gerhard Hring <gh@ghaering.de>
+# Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
@@ -158,6 +157,7 @@
self.con.create_function("isblob", 1, func_isblob)
self.con.create_function("islonglong", 1, func_islonglong)
self.con.create_function("spam", -1, func)
+ self.con.execute("create table test(t text)")
def tearDown(self):
self.con.close()
@@ -276,18 +276,36 @@
val = cur.fetchone()[0]
self.assertEqual(val, 2)
+ # Regarding deterministic functions:
+ #
+ # Between 3.8.3 and 3.15.0, deterministic functions were only used to
+ # optimize inner loops, so for those versions we can only test if the
+ # sqlite machinery has factored out a call or not. From 3.15.0 and onward,
+ # deterministic functions were permitted in WHERE clauses of partial
+ # indices, which allows testing based on syntax, iso. the query optimizer.
+ @unittest.skipIf(sqlite.sqlite_version_info < (3, 8, 3), "Requires SQLite 3.8.3 or higher")
def CheckFuncNonDeterministic(self):
mock = unittest.mock.Mock(return_value=None)
- self.con.create_function("deterministic", 0, mock, deterministic=False)
- self.con.execute("select deterministic() = deterministic()")
- self.assertEqual(mock.call_count, 2)
+ self.con.create_function("nondeterministic", 0, mock, deterministic=False)
+ if sqlite.sqlite_version_info < (3, 15, 0):
+ self.con.execute("select nondeterministic() = nondeterministic()")
+ self.assertEqual(mock.call_count, 2)
+ else:
+ with self.assertRaises(sqlite.OperationalError):
+ self.con.execute("create index t on test(t) where nondeterministic() is not null")
- @unittest.skipIf(sqlite.sqlite_version_info < (3, 8, 3), "deterministic parameter not supported")
+ @unittest.skipIf(sqlite.sqlite_version_info < (3, 8, 3), "Requires SQLite 3.8.3 or higher")
def CheckFuncDeterministic(self):
mock = unittest.mock.Mock(return_value=None)
self.con.create_function("deterministic", 0, mock, deterministic=True)
- self.con.execute("select deterministic() = deterministic()")
- self.assertEqual(mock.call_count, 1)
+ if sqlite.sqlite_version_info < (3, 15, 0):
+ self.con.execute("select deterministic() = deterministic()")
+ self.assertEqual(mock.call_count, 1)
+ else:
+ try:
+ self.con.execute("create index t on test(t) where deterministic() is not null")
+ except sqlite.OperationalError:
+ self.fail("Unexpected failure while creating partial index")
@unittest.skipIf(sqlite.sqlite_version_info >= (3, 8, 3), "SQLite < 3.8.3 needed")
def CheckFuncDeterministicNotSupported(self):
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment