Repository navigation
test: add fuzz testing using hypothesis - #57
sumanjeet0012 wants to merge 3 commits into
Conversation
acul71
left a comment
There was a problem hiding this comment.
Review (maintainer) — Request changes
Thanks for adding Hypothesis fuzz coverage for decode() — this aligns well with #43 and CI is green.
Blocker
Missing newsfragment for issue #43. Please add something like:
newsfragments/43.misc.rst
Added Hypothesis-based fuzz tests for ``decode()`` robustness.(File must end with a newline.) Type misc or internal is appropriate for a test-only change.
Also recommended
- Rebase onto current
origin/master(branch is ~6 commits behind; dry-run merge had no conflicts, butpyproject.tomloverlaps with open #49 and #56). - In
test_roundtrip_never_crashes, when both encode and decode succeed, assertdecoded == dataso silent corruption cannot pass. - Consider seeding Hypothesis with multibase spec vectors (closer to go-multibase
FuzzDecode/ the #43 proposal).
Validation (local)
make lint— passmake typecheck— passmake test— 269 passedmake docs-ci— pass
Full write-up: maintained locally as AI-PR-REVIEW-57-0.md.
|
Hi @sumanjeet0012 — friendly follow-up. I requested changes on this PR on 2026-09-07 (mainly the missing towncrier newsfragment, plus the other notes in that review). I don’t see any new commits addressing those items yet. Are you still willing / able to carry this PR forward? If yes, please push the requested updates when you can and I’ll re-review promptly. If your bandwidth has changed, no worries — just say so and we can close it or leave it for someone else to pick up. |
🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
acul71
left a comment
There was a problem hiding this comment.
Re-review — newsfragment OK; one recommended fix + sync
Thanks for adding newsfragments/43.internal.rst — the prior mandatory blocker is resolved.
Still please address
- Sync with
master— remote tip is 10 behind / 3 ahead. Local merge into a worktree was clean;maintainerCanModifyis false so please rebase/merge yourself (and consider enabling maintainer edits). - In
test_roundtrip_never_crashes, when encode+decode both succeed, pleaseassert decoded == dataso silent corruption cannot pass:encoded = encode(enc.encoding, data) decoded = decode(encoded) assert decoded == data
Optional (non-blocking): seed Hypothesis with multibase spec vectors.
Validation (worktree after merging master)
- Local:
make lint,typecheck,test(361 passed, 9 skipped),docs-ci— green. - GitHub CI on tip: green.
Happy to approve once the roundtrip assert is in and the branch is synced.
Fixes #43
Description
This pull request introduces fuzz testing for the
py-multibasedecoder. It implements the fuzz target usinghypothesisto exercise the decode pipeline with random binary, string, and encoded permutations to ensure the package handles malformed input safely without crashing.Changes
hypothesisas a development dependency inpyproject.toml.tests/test_fuzz.pycontaining:test_decode_never_crashestest_decode_string_never_crashestest_roundtrip_never_crashes