test: add fuzz testing using hypothesis - #57
Open
sumanjeet0012 wants to merge 2 commits into
Open
Conversation
acul71
requested changes
Sep 7, 2026
acul71
left a comment
Contributor
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.
This was referenced Sep 7, 2026
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.
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