aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/sqlite3/test
diff options
context:
space:
mode:
authorErlend Egeberg Aasland <erlend.aasland@innova.no>2020-11-17 16:55:12 +0100
committerGitHub <noreply@github.com>2020-11-17 17:55:12 +0200
commita1f401a58b213e400fbd8f0fa8dc5260a2389dab (patch)
tree8531d513ccfbe7479ffa0420d088af144d0603ac /Lib/sqlite3/test
parent296a796951032f678d063008f588ccc6958d0df1 (diff)
downloadcpython-a1f401a58b213e400fbd8f0fa8dc5260a2389dab.tar.gz
cpython-a1f401a58b213e400fbd8f0fa8dc5260a2389dab.zip
bpo-42264: Deprecate sqlite3.OptimizedUnicode (GH-23163)
Diffstat (limited to 'Lib/sqlite3/test')
-rw-r--r--Lib/sqlite3/test/factory.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/sqlite3/test/factory.py b/Lib/sqlite3/test/factory.py
index 95dd24bdfad..d91997333b1 100644
--- a/Lib/sqlite3/test/factory.py
+++ b/Lib/sqlite3/test/factory.py
@@ -254,9 +254,10 @@ class TextFactoryTests(unittest.TestCase):
self.assertTrue(row[0].endswith("reich"), "column must contain original data")
def CheckOptimizedUnicode(self):
- # In py3k, str objects are always returned when text_factory
- # is OptimizedUnicode
- self.con.text_factory = sqlite.OptimizedUnicode
+ # OptimizedUnicode is deprecated as of Python 3.10
+ with self.assertWarns(DeprecationWarning) as cm:
+ self.con.text_factory = sqlite.OptimizedUnicode
+ self.assertIn("factory.py", cm.filename)
austria = "Österreich"
germany = "Deutchland"
a_row = self.con.execute("select ?", (austria,)).fetchone()