Approvaltests

Latest version: v14.2.0

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

Scan your dependencies

Page 6 of 18

8.1.0

Easy way to remove entire lines based on a keyword.

Example:

python
text = """
line 1
remove me
line 2
also remove me
line 3
"""
text_to_remove = "remove"

verify(text, options=Options().with_scrubber(create_line_scrubber(text_to_remove)))


will produce:


text
line 1
line 2
line 3
`

8.0.0

7.4.0

To avoid too many diff tools being launched, ApprovalTests will stop launching after the 5th time.
This is configurable in
python
GenericDiffReporter.throttling_threshold

7.3.0

MrJobApprovals mistakenly did not allow you to pass options, it does not.

This is an api change, hence the minor version bump

7.2.0

You can invoke a `verify()` call from the command line
This allows invoking python approvals from any other stack via subprocesses.

Usage:

python -m approvaltests --test-id hello --received "hello world!"

or

python -m approvaltests -t hello -r "hello world!"

or

echo "hello world!" | python -m approvaltests -t hello

7.1.0

What
You can now easily `verify` command line outputs.

You can also pass inputs into the command line under test, including Iterables.

Why
This allows you to easily test non-python programs from ApprovalTests.

How
[see example here](https://github.com/approvals/ApprovalTests.Python/blob/main/tests/utilities/test_command_line_callouts.py#L8)

Page 6 of 18

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.