Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-95432: Add doctests for the sqlite3 docs #96225

Merged
merged 6 commits into from Aug 29, 2022

Conversation

erlend-aasland
Copy link
Contributor

@erlend-aasland erlend-aasland commented Aug 24, 2022

As a consequence of the added test, this commit also includes
fixes for broken examples.

As a consequence of the added test, this commit also includes
fixes for broken examples.
@erlend-aasland
Copy link
Contributor Author

erlend-aasland commented Aug 24, 2022

FYI:

  • doctests for the tutorial were added in gh-95432: Add doctest for sqlite3 tutorial #96193
  • I converted some examples from ordinary code blocks to doctest:: blocks, in order to both show and test the expected output
  • I'll create a separate PR for making the SQL style consistent1
  • As noted in the OP, this PR includes fixes for broken examples

Footnotes

  1. I did update the style of some examples in this PR, but that was only because the code was touched in the first place

@ezio-melotti ezio-melotti self-requested a review August 24, 2022 13:33
- Add separate "namespace" for trace tests bco. callback
- Move more Cursor examples under the sqlite3.cursor namespace
Doc/library/sqlite3.rst Show resolved Hide resolved
Doc/library/sqlite3.rst Show resolved Hide resolved
@erlend-aasland erlend-aasland merged commit bf92597 into python:main Aug 29, 2022
@miss-islington
Copy link
Contributor

Thanks @erlend-aasland for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11.
🐍🍒⛏🤖

@erlend-aasland erlend-aasland deleted the sqlite-doctest-the-rest branch August 29, 2022 08:52
@miss-islington
Copy link
Contributor

Sorry, @erlend-aasland, I could not cleanly backport this to 3.10 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker bf9259776dff5348bc854983409ea68618c1f174 3.10

@bedevere-bot
Copy link

GH-96378 is a backport of this pull request to the 3.11 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 29, 2022
As a consequence of the added test, this commit also includes
fixes for broken examples.

- Add separate namespace for trace tests bco. module level callback
- Move more backup and cursor examples under separate namespaces
(cherry picked from commit bf92597)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
erlend-aasland added a commit to erlend-aasland/cpython that referenced this pull request Aug 29, 2022
)

As a consequence of the added test, this commit also includes
fixes for broken examples.

- Add separate namespace for trace tests bco. module level callback
- Move more backup and cursor examples under separate namespaces.
(cherry picked from commit bf92597)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
@bedevere-bot
Copy link

GH-96379 is a backport of this pull request to the 3.10 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Aug 29, 2022
@erlend-aasland erlend-aasland linked an issue Aug 29, 2022 that may be closed by this pull request
miss-islington added a commit that referenced this pull request Aug 29, 2022
As a consequence of the added test, this commit also includes
fixes for broken examples.

- Add separate namespace for trace tests bco. module level callback
- Move more backup and cursor examples under separate namespaces
(cherry picked from commit bf92597)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
erlend-aasland added a commit that referenced this pull request Aug 29, 2022
As a consequence of the added test, this commit also includes
fixes for broken examples.

- Add separate namespace for trace tests bco. module level callback
- Move more backup and cursor examples under separate namespaces.
(cherry picked from commit bf92597)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make sure all sqlite3 doc examples work
4 participants