Approvaltests

Latest version: v14.3.0

Safety actively analyzes 706267 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 15 of 18

1.1.0

Why Use Storyboards

Sometimes we might want to see different steps in a workflow or lifetime of an object. Storyboards are a convenience object to help enable that.

Approvaltests allows us to look at a complete object instead of just pieces of it. Storyboards allow us to track an object through time.

The mechanism to map time to space that storyboards use is very analogous to a comic book, but with each frame vertically after each other so that it works well with the diff tool and shows a progression.

How To Use Storyboards

Here is example of creating story board, adding content to it, and verifying it.

<!-- snippet: use_storyboard -->
<a id='snippet-use_storyboard'></a>
py
story = Storyboard()
story.add_description("Spinning wheel")
story.add_frame(ascii_wheel)
ascii_wheel.advance()
story.add_frame(ascii_wheel)
verify(story)

<!-- endSnippet -->

will produce

<!-- snippet: VerifyTests.test_simple_storyboard.approved.txt -->
<a id='snippet-VerifyTests.test_simple_storyboard.approved.txt'></a>
txt
Spinning wheel

Initial:
-

Frame 1:
\

<!-- endSnippet -->

1.0.1

A bug with the namer was introduced which is now fixed. No other changes

1.0.0

Verify(text) ensures a newline at the file
**BREAKING CHANGE**
Since most tools will ensure a newline at the end of a file, approval test is now
adding this to allow copying approval results in diff tools to work correctly.
Please note that this will break all you previous approvals that do *not* end with
a newline!

This will show by your diff tool opening with two files that look identical, but
one actually has a newline at the end.

Upgrade Path
We suggest you use `ReporterByCopyMoveCommandForEverythingToClipboard()` as your [Default Reporter](configuration.mdhow-to-configure-a-default-reporter-for-your-system) to re-approve all your files.

Namer handles multiple nested methods in a unit test
Previously if you had nested methods in your unit test, the names would incorrectly
identify the help method rather than the test method. This is now fixed.

0.8.0

You can now set the approval file extensions via options:
[Options().for_file.with_extension(".md")](https://github.com/approvals/ApprovalTests.Python/blob/master/docs/features.md#options---with-file-extension)

0.7.0

Date scrubbers are quite basic and only work with json-fied datetimes
Verify now converts its input to string before verifying

0.6.0

You can now scrub your approval files

Page 15 of 18

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.