Skip to content

Test the planner's _filter_out_none helper and validate documented imports in CI - #699

Draft
sophiecarreras wants to merge 1 commit into
masterfrom
qk-unit-and-doc-examples
Draft

sophiecarreras wants to merge 1 commit into
masterfrom
qk-unit-and-doc-examples

Conversation

@sophiecarreras

Copy link
Copy Markdown
Contributor

What

  • Direct unit tests for _filter_out_none in the emerge planner (drops only None, keeps order and other falsy values, lazy), plus its effect on EmergePlanner.min_part_size.
  • test/unit/test_documentation_examples.py: extracts every Python code block from README.md and doc/source/*.rst and checks that each import shown resolves against the installed b2sdk (module exists, imported name exists). The examples need a live B2 account, so imports are what can be verified offline.
  • New doc_examples nox session, run by a "Compile documentation examples" step in the build CI job.
  • Changelog fragment (infrastructure).

Verification (local)

  • New tests pass under --api=v3/v2/v1/v0; full test/unit passes for v3, v2, v1. On v0 there are 28 errors in test/unit/v0/test_raw_api.py, which also fail on a clean checkout.
  • Mutation checks, each reverted: inverting the is not None test in _filter_out_none fails 10 tests; changing it to a truthiness test fails the falsy-values case; renaming an imported name in doc/source/tutorial.rst fails the matching documented-import test.
  • ruff check and ruff format --check (0.8.6) are clean for the new files. noxfile.py has one pre-existing format difference at the release_check string, not touched here.
  • Not verified locally: the nox -s doc_examples session and the CI step. uv sync fails here building watchdog (macOS SDK linker error), so I ran pytest from an equivalent venv instead.

Found while testing (not changed)

EmergePlanner() with all limits unset raises TypeError: 'int' object is not iterable, because min(DEFAULT_MIN_PART_SIZE, *_filter_out_none(None, None)) becomes min(int). No test pins this down.

🤖 Generated with Claude Code

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>
@coderabbitai

coderabbitai Bot commented Nov 21, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant