8000 bpo-42847: Normalise Lib/sqlite3/test/* file encodings (GH-24147) · python/cpython@deab1e5 · GitHub
[go: up one dir, main page]

Skip to content

Commit deab1e5

Browse files
author
Erlend Egeberg Aasland
authored
bpo-42847: Normalise Lib/sqlite3/test/* file encodings (GH-24147)
Convert from ISO-8859-1 to UTF-8.
1 parent 849e339 commit deab1e5

File tree

6 files changed

+15
-21
lines changed

6 files changed

+15
-21
lines changed

Lib/sqlite3/test/dbapi.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
#-*- coding: iso-8859-1 -*-
21
# pysqlite2/test/dbapi.py: tests for DB-API compliance
32
#
4-
# Copyright (C) 2004-2010 Gerhard Häring <gh@ghaering.de>
3+
# Copyright (C) 2004-2010 Gerhard Häring <gh@ghaering.de>
54
#
65
# This file is part of pysqlite.
76
#

Lib/sqlite3/test/factory.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
#-*- coding: iso-8859-1 -*-
21
# pysqlite2/test/factory.py: tests for the various factories in pysqlite
32
#
4-
# Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de>
3+
# Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de>
54
#
65
# This file is part of pysqlite.
76
#
@@ -235,20 +234,20 @@ def setUp(self):
235234
self.con = sqlite.connect(":memory:")
236235

237236
def test_unicode(self):
238-
austria = "Österreich"
237+
austria = "Österreich"
239238
row = self.con.execute("select ?", (austria,)).fetchone()
240239
self.assertEqual(type(row[0]), str, "type of row[0] must be unicode")
241240

242241
def test_string(self):
243242
self.con.text_factory = bytes
244-
austria = "Österreich"
243+
austria = "Österreich"
245244
row = self.con.execute("select ?", (austria,)).fetchone()
246245
self.assertEqual(type(row[0]), bytes, "type of row[0] must be bytes")
247246
self.assertEqual(row[0], austria.encode("utf-8"), "column must equal original data in UTF-8")
248247

249248
def test_custom(self):
250249
self.con.text_factory = lambda x: str(x, "utf-8", "ignore")
251-
austria = "Österreich"
250+
austria = "Österreich"
252251
row = self.con.execute("select ?", (austria,)).fetchone()
253252
self.assertEqual(type(row[0]), str, "type of row[0] must be unicode")
254253
self.assertTrue(row[0].endswith("reich"), "column must contain original data")
@@ -258,7 +257,7 @@ def test_optimized_unicode(self):
258257
with self.assertWarns(DeprecationWarning) as cm:
259258
self.con.text_factory = sqlite.OptimizedUnicode
260259
self.assertIn("factory.py", cm.filename)
261-
austria = "Österreich"
260+
austria = "Österreich"
262261
germany = "Deutchland"
263262
a_row = self.con.execute("select ?", (austria,)).fetchone()
264263
d_row = self.con.execute("select ?", (germany,)).fetchone()

Lib/sqlite3/test/hooks.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
#-*- coding: iso-8859-1 -*-
21
# pysqlite2/test/hooks.py: tests for various SQLite-specific hooks
32
#
4-
# Copyright (C) 2006-2007 Gerhard Häring <gh@ghaering.de>
3+
# Copyright (C) 2006-2007 Gerhard Häring <gh@ghaering.de>
54
#
65
# This file is part of pysqlite.
76
#
@@ -42,7 +41,7 @@ def test_create_collation_not_callable(self):
4241
def test_create_collation_not_ascii(self):
4342
con = sqlite.connect(":memory:")
4443
with self.assertRaises(sqlite.ProgrammingError):
45-
con.create_collation("collä", lambda x, y: (x > y) - (x < y))
44+
con.create_collation("collä", lambda x, y: (x > y) - (x < y))
4645

4746
def test_create_collation_bad_upper(self):
4847
class BadUpperStr(str):

Lib/sqlite3/test/regression.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
#-*- coding: iso-8859-1 -*-
21
# pysqlite2/test/regression.py: pysqlite regression tests
32
#
4-
# Copyright (C) 2006-2010 Gerhard Häring <gh@ghaering.de>
3+
# Copyright (C) 2006-2010 Gerhard Häring <gh@ghaering.de>
54
#
65
# This file is part of pysqlite.
76
#

Lib/sqlite3/test/transactions.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
#-*- coding: iso-8859-1 -*-
21
# pysqlite2/test/transactions.py: tests transactions
32
#
4-
# Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de>
3+
# Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de>
54
#
65
# This file is part of pysqlite.
76
#

Lib/sqlite3/test/types.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
#-*- coding: iso-8859-1 -*-
21
# pysqlite2/test/types.py: tests for type conversion and detection
32
#
4-
# Copyright (C) 2005 Gerhard Häring <gh@ghaering.de>
3+
# Copyright (C) 2005 Gerhard Häring <gh@ghaering.de>
54
#
65
# This file is part of pysqlite.
76
#
@@ -41,10 +40,10 @@ def tearDown(self):
4140
self.con.close()
4241

4342
def test_string(self):
44-
self.cur.execute("insert into test(s) values (?)", ("Österreich",))
43+
self.cur.execute("insert into test(s) values (?)", ("Österreich",))
4544
self.cur.execute("select s from test")
4645
row = self.cur.fetchone()
47-
self.assertEqual(row[0], "Österreich")
46+
self.assertEqual(row[0], "Österreich")
4847

4948
def test_small_int(self):
5049
self.cur.execute("insert into test(i) values (?)", (42,))
@@ -75,9 +74,9 @@ def test_blob(self):
7574
self.assertEqual(row[0], sample)
7675

7776
def test_unicode_execute(self):
78-
self.cur.execute("select 'Österreich'")
77+
self.cur.execute("select 'Österreich'")
7978
row = self.cur.fetchone()
80-
self.assertEqual(row[0], "Österreich")
79+
self.assertEqual(row[0], "Österreich")
8180

8281
class DeclTypesTests(unittest.TestCase):
8382
class Foo:

0 commit comments

Comments
 (0)
0