Repository navigation
Test the planner's _filter_out_none helper and validate documented imports in CI - #699
Draft
sophiecarreras wants to merge 1 commit into
Draft
sophiecarreras wants to merge 1 commit into
sophiecarreras wants to merge 1 commit into
Conversation
Add direct unit tests for the emerge planner's _filter_out_none predicate helper, and a test plus a doc_examples nox session and CI step that check every import shown in the README and Sphinx examples resolves against the public b2sdk API. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
_filter_out_nonein the emerge planner (drops onlyNone, keeps order and other falsy values, lazy), plus its effect onEmergePlanner.min_part_size.test/unit/test_documentation_examples.py: extracts every Python code block fromREADME.mdanddoc/source/*.rstand checks that eachimportshown resolves against the installedb2sdk(module exists, imported name exists). The examples need a live B2 account, so imports are what can be verified offline.doc_examplesnox session, run by a "Compile documentation examples" step in thebuildCI job.infrastructure).Verification (local)
--api=v3/v2/v1/v0; fulltest/unitpasses for v3, v2, v1. On v0 there are 28 errors intest/unit/v0/test_raw_api.py, which also fail on a clean checkout.is not Nonetest in_filter_out_nonefails 10 tests; changing it to a truthiness test fails the falsy-values case; renaming an imported name indoc/source/tutorial.rstfails the matching documented-import test.ruff checkandruff format --check(0.8.6) are clean for the new files.noxfile.pyhas one pre-existing format difference at therelease_checkstring, not touched here.nox -s doc_examplessession and the CI step.uv syncfails here buildingwatchdog(macOS SDK linker error), so I ran pytest from an equivalent venv instead.Found while testing (not changed)
EmergePlanner()with all limits unset raisesTypeError: 'int' object is not iterable, becausemin(DEFAULT_MIN_PART_SIZE, *_filter_out_none(None, None))becomesmin(int). No test pins this down.🤖 Generated with Claude Code