All verify() methods take an optional options parameter to configure reporters, scrubbers, file extensions, etc. See the Options diagram for more details.
Chain the options you need onto Options():
verify(
"Hello, World!",
options=Options()
.with_scrubber(lambda text: text.replace("World", "Approvals"))
.for_file.with_extension(".md"),
)- Pycharm automatically removes trailing whitespace, which can cause the approval file to be different from the actual output.
- To disable this behavior go to:
- File -> Settings -> Editor -> General -> On Save -> [ ] Remove trailing spaces