aboutsummaryrefslogtreecommitdiff
path: root/Lib
diff options
context:
space:
mode:
authorErlend Egeberg Aasland <erlend.aasland@innova.no>2021-01-07 01:36:35 +0100
committerGitHub <noreply@github.com>2021-01-07 02:36:35 +0200
commitdeab1e54ff1695cdbe87f8db3d2c382d8e78330f (patch)
tree07e0d8d6cac0d13a29a3817dc4cc968baf64165b /Lib
parentbpo-40823: Use loadTestsFromTestCase() iso. makeSuite() in sqlite3 tests (GH-... (diff)
downloadcpython-deab1e54ff1695cdbe87f8db3d2c382d8e78330f.tar.gz
cpython-deab1e54ff1695cdbe87f8db3d2c382d8e78330f.tar.bz2
cpython-deab1e54ff1695cdbe87f8db3d2c382d8e78330f.zip
bpo-42847: Normalise Lib/sqlite3/test/* file encodings (GH-24147)
Convert from ISO-8859-1 to UTF-8.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/sqlite3/test/dbapi.py3
-rw-r--r--Lib/sqlite3/test/factory.py11
-rw-r--r--Lib/sqlite3/test/hooks.py5
-rw-r--r--Lib/sqlite3/test/regression.py3
-rw-r--r--Lib/sqlite3/test/transactions.py3
-rw-r--r--Lib/sqlite3/test/types.py11
6 files changed, 15 insertions, 21 deletions
diff --git a/Lib/sqlite3/test/dbapi.py b/Lib/sqlite3/test/dbapi.py
index 7985cd3fcf9..68a30622395 100644
--- a/Lib/sqlite3/test/dbapi.py
+++ b/Lib/sqlite3/test/dbapi.py
@@ -1,7 +1,6 @@
-#-*- coding: iso-8859-1 -*-
# pysqlite2/test/dbapi.py: tests for DB-API compliance
#
-# Copyright (C) 2004-2010 Gerhard Häring <gh@ghaering.de>
+# Copyright (C) 2004-2010 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
diff --git a/Lib/sqlite3/test/factory.py b/Lib/sqlite3/test/factory.py
index 9eebb7beef1..87642849754 100644
--- a/Lib/sqlite3/test/factory.py
+++ b/Lib/sqlite3/test/factory.py
@@ -1,7 +1,6 @@
-#-*- coding: iso-8859-1 -*-
# pysqlite2/test/factory.py: tests for the various factories in pysqlite
#
-# Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de>
+# Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
@@ -235,20 +234,20 @@ class TextFactoryTests(unittest.TestCase):
self.con = sqlite.connect(":memory:")
def test_unicode(self):
- austria = "Österreich"
+ austria = "Österreich"
row = self.con.execute("select ?", (austria,)).fetchone()
self.assertEqual(type(row[0]), str, "type of row[0] must be unicode")
def test_string(self):
self.con.text_factory = bytes
- austria = "Österreich"
+ austria = "Österreich"
row = self.con.execute("select ?", (austria,)).fetchone()
self.assertEqual(type(row[0]), bytes, "type of row[0] must be bytes")
self.assertEqual(row[0], austria.encode("utf-8"), "column must equal original data in UTF-8")
def test_custom(self):
self.con.text_factory = lambda x: str(x, "utf-8", "ignore")
- austria = "Österreich"
+ austria = "Österreich"
row = self.con.execute("select ?", (austria,)).fetchone()
self.assertEqual(type(row[0]), str, "type of row[0] must be unicode")
self.assertTrue(row[0].endswith("reich"), "column must contain original data")
@@ -258,7 +257,7 @@ class TextFactoryTests(unittest.TestCase):
with self.assertWarns(DeprecationWarning) as cm:
self.con.text_factory = sqlite.OptimizedUnicode
self.assertIn("factory.py", cm.filename)
- austria = "Österreich"
+ austria = "Österreich"
germany = "Deutchland"
a_row = self.con.execute("select ?", (austria,)).fetchone()
d_row = self.con.execute("select ?", (germany,)).fetchone()
diff --git a/Lib/sqlite3/test/hooks.py b/Lib/sqlite3/test/hooks.py
index 4250888377c..a219e8911f7 100644
--- a/Lib/sqlite3/test/hooks.py
+++ b/Lib/sqlite3/test/hooks.py
@@ -1,7 +1,6 @@
-#-*- coding: iso-8859-1 -*-
# pysqlite2/test/hooks.py: tests for various SQLite-specific hooks
#
-# Copyright (C) 2006-2007 Gerhard Häring <gh@ghaering.de>
+# Copyright (C) 2006-2007 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
@@ -42,7 +41,7 @@ class CollationTests(unittest.TestCase):
def test_create_collation_not_ascii(self):
con = sqlite.connect(":memory:")
with self.assertRaises(sqlite.ProgrammingError):
- con.create_collation("collä", lambda x, y: (x > y) - (x < y))
+ con.create_collation("collä", lambda x, y: (x > y) - (x < y))
def test_create_collation_bad_upper(self):
class BadUpperStr(str):
diff --git a/Lib/sqlite3/test/regression.py b/Lib/sqlite3/test/regression.py
index 1312424cfab..c8e0b27564a 100644
--- a/Lib/sqlite3/test/regression.py
+++ b/Lib/sqlite3/test/regression.py
@@ -1,7 +1,6 @@
-#-*- coding: iso-8859-1 -*-
# pysqlite2/test/regression.py: pysqlite regression tests
#
-# Copyright (C) 2006-2010 Gerhard Häring <gh@ghaering.de>
+# Copyright (C) 2006-2010 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
diff --git a/Lib/sqlite3/test/transactions.py b/Lib/sqlite3/test/transactions.py
index 3b47ff174a0..80284902a1a 100644
--- a/Lib/sqlite3/test/transactions.py
+++ b/Lib/sqlite3/test/transactions.py
@@ -1,7 +1,6 @@
-#-*- coding: iso-8859-1 -*-
# pysqlite2/test/transactions.py: tests transactions
#
-# Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de>
+# Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
diff --git a/Lib/sqlite3/test/types.py b/Lib/sqlite3/test/types.py
index df8aad989a8..92ec6349f8b 100644
--- a/Lib/sqlite3/test/types.py
+++ b/Lib/sqlite3/test/types.py
@@ -1,7 +1,6 @@
-#-*- coding: iso-8859-1 -*-
# pysqlite2/test/types.py: tests for type conversion and detection
#
-# Copyright (C) 2005 Gerhard Häring <gh@ghaering.de>
+# Copyright (C) 2005 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
@@ -41,10 +40,10 @@ class SqliteTypeTests(unittest.TestCase):
self.con.close()
def test_string(self):
- self.cur.execute("insert into test(s) values (?)", ("Österreich",))
+ self.cur.execute("insert into test(s) values (?)", ("Österreich",))
self.cur.execute("select s from test")
row = self.cur.fetchone()
- self.assertEqual(row[0], "Österreich")
+ self.assertEqual(row[0], "Österreich")
def test_small_int(self):
self.cur.execute("insert into test(i) values (?)", (42,))
@@ -75,9 +74,9 @@ class SqliteTypeTests(unittest.TestCase):
self.assertEqual(row[0], sample)
def test_unicode_execute(self):
- self.cur.execute("select 'Österreich'")
+ self.cur.execute("select 'Österreich'")
row = self.cur.fetchone()
- self.assertEqual(row[0], "Österreich")
+ self.assertEqual(row[0], "Österreich")
class DeclTypesTests(unittest.TestCase):
class Foo: