Repository navigation
Conversation
tony
pushed a commit
that referenced
this pull request
Dec 2, 2026
why: Path.as_uri() percent-encodes metacharacters in file:/// URIs, empty PathLike values match between every character, and precompiling patterns in VtSnapshotExtension.configure avoids wrapper types while validating inputs eagerly. what: - Reuse _compile_scrubber_pattern in VtSnapshotExtension.configure - Reject empty PathLike scrubber paths with ValueError - Match mixed separators, lowercase Windows drive letters, and RFC 8089 percent-encoded file:/// URIs in _compile_scrubber_pattern - Move the CHANGES entry under What's new (#150) and expand tests
why: Snapshot assertions need a literal temporary path rule and an
explicit way to scrub URIs.
what:
- Bind PathLike values once for testing and Syrupy callers
- Preserve URI context across wrapped and cropped capture rows
- Support Windows path spellings and explicit URI regex rules
- Cover literal, URI and region cases in tests and the API reference
why: Readers replacing a path regex need a separate rule for URI text. what: - Demonstrate literal path and explicit URI matches in a runnable example - Document migration for URI scrubbers and hidden crop prefixes
why: Record the branch's user-visible change in the unreleased notes. what: - Add the #150 entry under What's new in CHANGES
tony
force-pushed
the
fix/148-pathlike-scrubbers
branch
from
December 3, 2026 02:55
4eed00a to
127652b
Compare
tony
changed the base branch from
master
to
fix/145-scrubber-scrollback-pullback
December 3, 2026 02:55
This branch was successfully 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.
Summary
os.PathLike[str]values inScrubberSpec,vt_screen,serialize_vt_snapshot, andVtSnapshotExtension.configure.strpaths. Match either separator and either case of a drive letter forPureWindowsPathvalues.In
v0.0.1a5,ScrubberSpeconly acceptsstrandre.Pattern[str]and compiles strings directly withre.compile(). Passingstr(tmp_path)raisesre.PatternErroron Windows\Upath segments and treats POSIX directory segments like[case0]orc++as regex syntax, while passingtmp_pathdirectly fails static type-checking and runtime matching.This change builds on the captured-row scrubber behavior in #149.
Fixes #148
Before (
v0.0.1a5with[(str(PureWindowsPath("C:/Users/runner/Temp/run1")), "<TMP>")]):After (
[(PureWindowsPath("C:/Users/runner/Temp/run1"), "<TMP>")]):Changes by area
Snapshot scrubbing
src/libvt/testing.py: widenScrubberSpecto includeos.PathLike[str], reject empty orbytesscrubber patterns, and compile literalPathLikescrubbers with escaped segments,[\\/]separator matching, and case-insensitive Windows drive letters.src/libvt/contrib/syrupy.py: bind scrubber patterns inVtSnapshotExtension.configure()before memoizing configured extensions.tests/test_testing.py: coverPureWindowsPathseparator, drive-case and UNC paths, exact spelling for generic providers, POSIX metacharacters, and explicit URI rules across wraps and crops.tests/test_syrupy.py: coverVtSnapshotExtension.configure()memoization, serialization, and empty-path validation acrossPurePosixPathand unhashableos.PathLike[str]scrubbers.docs/api/testing.md,docs/topics/testing.md,MIGRATION,CHANGES: document literalos.PathLikescrubbers and explicit regex rules for URI text.Test plan
ty checkon Linux across Python 3.12–3.15.ruff check .andruff format --check .pytestsuite including documentation doctestsjust -f docs/justfile sphinxopts="-W --keep-going" html