diff --git a/Lib/test/test_sqlite3/__init__.py b/Lib/test/test_sqlite3/__init__.py new file mode 100644 index 00000000000000..099c01e3b3cc70 --- /dev/null +++ b/Lib/test/test_sqlite3/__init__.py @@ -0,0 +1,18 @@ +from test.support import import_helper, load_package_tests, verbose + +# Skip test if _sqlite3 module not installed. +import_helper.import_module('_sqlite3') + +import unittest +import os +import sqlite3 + +# Implement the unittest "load tests" protocol. +def load_tests(*args): + pkg_dir = os.path.dirname(__file__) + return load_package_tests(pkg_dir, *args) + +if verbose: + print("test_sqlite3: testing with version", + "{!r}, sqlite_version {!r}".format(sqlite3.version, + sqlite3.sqlite_version)) diff --git a/Lib/test/test_sqlite3/__main__.py b/Lib/test/test_sqlite3/__main__.py new file mode 100644 index 00000000000000..b10a54aa15272e --- /dev/null +++ b/Lib/test/test_sqlite3/__main__.py @@ -0,0 +1,4 @@ +#from test.test_sqlite3 import load_tests +import unittest + +unittest.main('test.test_sqlite3') diff --git a/Lib/test/test_sqlite3/test_dbapi.py b/Lib/test/test_sqlite3/test_dbapi.py index 18e84e9e58632b..7a7b3ca587f386 100644 --- a/Lib/test/test_sqlite3/test_dbapi.py +++ b/Lib/test/test_sqlite3/test_dbapi.py @@ -42,14 +42,14 @@ def memory_database(*args, **kwargs): return contextlib.closing(cx) -# Temporarily limit a database connection parameter -@contextlib.contextmanager -def cx_limit(cx, category=sqlite.SQLITE_LIMIT_SQL_LENGTH, limit=128): - try: - _prev = cx.setlimit(category, limit) - yield limit - finally: - cx.setlimit(category, _prev) +### Temporarily limit a database connection parameter +##@contextlib.contextmanager +##def cx_limit(cx, category=sqlite.SQLITE_LIMIT_SQL_LENGTH, limit=128): +## try: +## _prev = cx.setlimit(category, limit) +## yield limit +## finally: +## cx.setlimit(category, _prev) class ModuleTests(unittest.TestCase): @@ -1889,4 +1889,4 @@ def wait(): if __name__ == "__main__": - unittest.main() + unittest.main(verbosity=2) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy