summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_sqlite3
diff options
context:
space:
mode:
authorKalyan <kalyan.ben10@live.com>2022-06-07 23:34:50 (GMT)
committerGitHub <noreply@github.com>2022-06-07 23:34:50 (GMT)
commitffc58a9710172b2d716a810a9f303828f3ebf108 (patch)
tree09f09c68560fa331909287e6284738719bd95417 /Lib/test/test_sqlite3
parentf8eae6f5c35e9def07a732f6bc7744aae106f9b2 (diff)
downloadcpython-ffc58a9710172b2d716a810a9f303828f3ebf108.zip
cpython-ffc58a9710172b2d716a810a9f303828f3ebf108.tar.gz
cpython-ffc58a9710172b2d716a810a9f303828f3ebf108.tar.bz2
gh-93370: Deprecate sqlite3.version and sqlite3.version_info (#93482)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Diffstat (limited to 'Lib/test/test_sqlite3')
-rw-r--r--Lib/test/test_sqlite3/test_dbapi.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_sqlite3/test_dbapi.py b/Lib/test/test_sqlite3/test_dbapi.py
index 1fa02db..b958bf1 100644
--- a/Lib/test/test_sqlite3/test_dbapi.py
+++ b/Lib/test/test_sqlite3/test_dbapi.py
@@ -57,6 +57,17 @@ class ModuleTests(unittest.TestCase):
self.assertEqual(sqlite.apilevel, "2.0",
"apilevel is %s, should be 2.0" % sqlite.apilevel)
+ def test_deprecated_version(self):
+ msg = "deprecated and will be removed in Python 3.14"
+ for attr in "version", "version_info":
+ with self.subTest(attr=attr):
+ with self.assertWarnsRegex(DeprecationWarning, msg) as cm:
+ getattr(sqlite, attr)
+ self.assertEqual(cm.filename, __file__)
+ with self.assertWarnsRegex(DeprecationWarning, msg) as cm:
+ getattr(sqlite.dbapi2, attr)
+ self.assertEqual(cm.filename, __file__)
+
def test_thread_safety(self):
self.assertIn(sqlite.threadsafety, {0, 1, 3},
"threadsafety is %d, should be 0, 1 or 3" %