summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_sqlite3
Commit message (Collapse)AuthorAgeFilesLines
* [3.13] add missing gc_collect() calls in sqlite3 tests (GH-127446) (#127500)Miss Islington (bot)2024-12-021-0/+2
| | | | | | add missing gc_collect() calls in sqlite3 tests (GH-127446) (cherry picked from commit 2a373da7700cf928e0a5ce3998d19351a3565df4) Co-authored-by: CF Bolz-Tereick <cfbolz@gmx.de>
* [3.13] gh-123849: Fix test_sqlite3.test_table_dump when foreign keys are ↵Miss Islington (bot)2024-10-131-1/+2
| | | | | | | enabled by default (GH-123859) (#125163) (cherry picked from commit 14b44c58e195c4cdee6594a4aacf8bf95b19fcd7) Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
* gh-118406: Add signature for sqlite3.Connection objects (#118428)Erlend E. Aasland2024-04-301-0/+5
|
* gh-118221: Always use the default row factory in sqlite3.iterdump() (#118223)Erlend E. Aasland2024-04-251-0/+15
| | | | | | | | | | | | sqlite3.iterdump() depends on the row factory returning resulting rows as tuples; it will fail with custom row factories like for example a dict factory. With this commit, we explicitly reset the row factory of the cursor used by iterdump(), so we always get predictable results. This does not affect the row factory of the parent connection. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-117995: Don't raise DeprecationWarnings for indexed nameless params (#118001)Erlend E. Aasland2024-04-221-0/+14
| | | | | Filter out '?NNN' placeholders when looking for named params. Co-authored-by: AN Long <aisk@users.noreply.github.com>
* gh-116303: Skip test module dependent tests if test modules are unavailable ↵Erlend E. Aasland2024-04-031-7/+11
| | | | (#117341)
* gh-91602: Add iterdump() support for filtering database objects (#114501)Mariusz Felisiak2024-02-061-0/+70
| | | | | | Add optional 'filter' parameter to iterdump() that allows a "LIKE" pattern for filtering database objects to dump. Co-authored-by: Erlend E. Aasland <erlend@python.org>
* gh-114099: Add test exclusions to support running the test suite on iOS ↵Russell Keith-Magee2024-02-051-3/+3
| | | | | | | | | | | | | (#114889) Add test annotations required to run the test suite on iOS (PEP 730). The majority of the change involve annotating tests that use subprocess, but are skipped on Emscripten/WASI for other reasons, and including iOS/tvOS/watchOS under the same umbrella as macOS/darwin checks. `is_apple` and `is_apple_mobile` test helpers have been added to identify *any* Apple platform, and "any Apple platform except macOS", respectively.
* gh-108364: In sqlite3, disable foreign keys before dumping SQL schema (#113957)Mariusz Felisiak2024-01-121-3/+11
| | | | | | | sqlite3.Connection.iterdump now ensures that foreign key support is disabled before dumping the database schema, if there is any foreign key violation. Co-authored-by: Erlend E. Aasland <erlend@python.org>
* gh-109653: Remove unused imports in the `Lib/` directory (#109803)Alex Waygood2023-09-243-3/+1
|
* gh-108590: Revert gh-108657 (commit 400a1cebc) (#108686)Erlend E. Aasland2023-08-301-15/+0
| | | Reverted per Serhiy's request.
* gh-108590: Fix sqlite3.iterdump for invalid Unicode in TEXT columns (#108657)Corvin2023-08-301-0/+15
| | | Co-authored-by: Erlend E. Aasland <erlend@python.org>
* gh-108278: Deprecate passing the first param of sqlite3.Connection callback ↵Erlend E. Aasland2023-08-292-0/+57
| | | | | | | | | | | | APIs by keyword (#108632) Deprecate passing the callback callable by keyword for the following sqlite3.Connection APIs: - set_authorizer(authorizer_callback) - set_progress_handler(progress_handler, ...) - set_trace_callback(trace_callback) The affected parameters will become positional-only in Python 3.15.
* gh-108617: Extend interactive session tests for sqlite3 (GH-108556)Serhiy Storchaka2023-08-291-6/+32
|
* gh-108558: Improve sqlite3 row factory tests (#108578)Edward Schauman-Haigh2023-08-291-14/+14
| | | | | | | | | Add test_sqlite_row_keys() to explicitly test sqlite3.Row.keys(). Cleanups: - Reduce test noise by converting docstrings to regular comments - Reduce boilerplate code by adding a setUp() method to RowFactoryTests Co-authored-by: Erlend E. Aasland <erlend@python.org>
* gh-108278: Deprecate passing the three first params as keyword args for ↵Erlend E. Aasland2023-08-281-0/+23
| | | | | | | | | | | sqlite3 UDF creation APIs (#108281) Deprecate passing name, number of arguments, and the callable as keyword arguments, for the following sqlite3.Connection APIs: - create_function(name, nargs, callable, ...) - create_aggregate(name, nargs, callable) The affected parameters will become positional-only in Python 3.15.
* gh-108550: Speed up sqlite3 tests (#108551)Erlend E. Aasland2023-08-283-98/+68
| | | | | | | | | | | | | Refactor the CLI so we can easily invoke it and mock command-line arguments. Adapt the CLI tests so we no longer have to launch a separate process. Disable the busy handler for all concurrency tests; we have full control over the order of the SQLite C API calls, so we can safely do this. The sqlite3 test suite now completes ~8 times faster than before. Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-64662: Add virtual table support to sqlite3.Connection.iterdump (#108340)Erlend E. Aasland2023-08-271-0/+20
| | | Co-authored-by: Aviv Palivoda <palaviv@gmail.com>
* gh-105539: Fix ResourceWarning from unclosed SQLite connections in ↵Mariusz Felisiak2023-08-232-4/+4
| | | | | | | | | | | | | test_sqlite3 (#108360) Follow up to 1a1bfc28912a39b500c578e9f10a8a222638d411. Explicitly manage connections in: - test_audit.test_sqlite3 - test_sqlite3.test_audit - test_sqlite3.test_backup Co-authored-by: Erlend E. Aasland <erlend@python.org>
* gh-105539: Emit ResourceWarning if sqlite3 database is not closed explicitly ↵Erlend E. Aasland2023-08-221-0/+6
| | | | (#108015)
* gh-105539: Explict resource management for connection objects in sqlite3 ↵Erlend E. Aasland2023-08-179-387/+373
| | | | | | | | tests (#108017) - Use memory_database() helper - Move test utility functions to util.py - Add convenience memory database mixin - Add check() helper for closed connection tests
* gh-93057: Deprecate positional use of optional sqlite3.connect() params ↵Erlend E. Aasland2023-08-152-1/+23
| | | | (#107948)
* gh-105875: Require SQLite 3.15.2 or newer (#105876)Erlend E. Aasland2023-06-185-78/+38
| | | SQLite 3.15.2 was released 2016-11-28.
* gh-105557: Remove duplicate sqlite3 test method (#105558)Erlend E. Aasland2023-06-091-7/+2
| | | | test_func_return_too_large_int() was defined twice. Keep only the redefined method, as that also checks the tracebacks.
* gh-100370: fix OverflowError in sqlite3.Connection.blobopen for 32-bit ↵Erlend E. Aasland2023-05-071-0/+8
| | | | builds (#103902)
* GH-103857: Deprecate utcnow and utcfromtimestamp (#103858)Paul Ganssle2023-04-271-1/+1
| | | | | Using `datetime.datetime.utcnow()` and `datetime.datetime.utcfromtimestamp()` will now raise a `DeprecationWarning`. We also have removed our internal uses of these functions and documented the change.
* gh-103489: Add get/set config methods to sqlite3.Connection (#103506)Erlend E. Aasland2023-04-261-0/+24
|
* GH-103805: Lib test f541 linting issue fix (#103812)Rodolfo M. Pereira2023-04-242-4/+4
| | | | | | | | | | | | | | | | This PR makes some minor linting adjustments to the Lib/test module caught by [ruff](https://github.com/charliermarsh/ruff). The adjustments are all related to the `F541 f-string without any placeholders` issue. Issue: https://github.com/python/cpython/issues/103805 <!-- gh-issue-number: gh-103805 --> * Issue: gh-103805 <!-- /gh-issue-number --> --------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Gregory P. Smith <greg@krypto.org>
* gh-101947: Remove size check from sqlite3 serialize test (#102914)Erlend E. Aasland2023-03-221-1/+0
| | | The size of the returned data is too implementation specific.
* gh-101693: In sqlite3, deprecate using named placeholders with parameters ↵Erlend E. Aasland2023-02-151-0/+15
| | | | supplied as a sequence (#101698)
* gh-100553: Improve accuracy of sqlite3.Row iter test (#100555)Nikita Sobolev2022-12-281-2/+8
|
* gh-99659: Use correct exceptions in sqlite3 bigmem tests (#99660)Łukasz Langa2022-11-211-4/+4
| | | | | | The tests in question were added in 0eec6276fdcd by Serhiy. Apparently, sqlite3 changed exceptions raised in those cases in the mean time but the tests never ran because they require a high `-M` setting in the test runner.
* gh-83638: Add sqlite3.Connection.autocommit for PEP 249 compliant behaviour ↵Erlend E. Aasland2022-11-121-0/+173
| | | | | | | | | | (#93823) Introduce the autocommit attribute to Connection and the autocommit parameter to connect() for PEP 249-compliant transaction handling. Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM> Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
* gh-77617: Add sqlite3 command-line interface (#95026)Erlend Egeberg Aasland2022-08-011-0/+155
| | | Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-95132: Correctly relay *args and **kwds from sqlite3.connect to factory ↵Erlend Egeberg Aasland2022-07-231-0/+20
| | | | | | | | | | | | (#95146) This PR partially reverts gh-24421 (PR) and fixes the remaining concerns given in gh-93044 (issue): - keyword arguments are passed as positional arguments to factory() - if an argument is not passed to sqlite3.connect(), its default value is passed to factory() Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-90016: Deprecate default sqlite3 adapters and converters (#94276)Erlend Egeberg Aasland2022-07-202-11/+26
| | | Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
* gh-94998: Remove redundant condition in test_sqlite3/__main__.py (#95052)Erlend Egeberg Aasland2022-07-201-2/+1
|
* gh-93370: Don't print deprecated pysqlite version in test_sqlite3 (#95017)Erlend Egeberg Aasland2022-07-191-3/+1
|
* gh-84461: Fix test_sqlite for Emscripten/WASI (#94125)Christian Heimes2022-06-231-1/+8
|
* gh-84623: Remove unused imports (#94132)Victor Stinner2022-06-221-1/+1
|
* gh-94028: Clear and reset sqlite3 statements properly in cursor iternext ↵Erlend Egeberg Aasland2022-06-211-0/+39
| | | | (GH-94042)
* gh-79009: sqlite3.iterdump now correctly handles tables with autoincrement ↵itssme2022-06-191-0/+47
| | | | | (#9621) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-93795: Use test.support TESTFN/unlink in sqlite3 tests (#93796)Erlend Egeberg Aasland2022-06-141-17/+15
|
* gh-79579: Improve DML query detection in sqlite3 (#93623)Erlend Egeberg Aasland2022-06-141-10/+56
| | | | | | | | | The fix involves using pysqlite_check_remaining_sql(), not only to check for multiple statements, but now also to strip leading comments and whitespace from SQL statements, so we can improve DML query detection. pysqlite_check_remaining_sql() is renamed lstrip_sql(), to more accurately reflect its function, and hardened to handle more SQL comment corner cases.
* gh-84623: Remove unused imports in tests (#93772)Victor Stinner2022-06-131-1/+0
|
* gh-93421: Update sqlite3 cursor.rowcount only after SQLITE_DONE (#93526)Erlend Egeberg Aasland2022-06-081-0/+8
|
* gh-93370: Deprecate sqlite3.version and sqlite3.version_info (#93482)Kalyan2022-06-071-0/+11
| | | | | 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>
* gh-93117: Remove too large sqlite3 bigmemtest (#93154)Erlend Egeberg Aasland2022-05-251-8/+1
|
* GH-93115: Fix version check in sqlite3 module constants test (#93116)Florian Bruhin2022-05-231-18/+18
|
* Clean up the sqlite3 tests (GH-93056)Serhiy Storchaka2022-05-212-33/+23
| | | | Remove helper managed_connect(). Use memory_database() or contextlib.closing() + addCleanup(unlink) instead.