Releases: approvals/ApprovalTests.Python
Rename 'Throttle' to 'Limit'
F!! rename 'throttle' to 'limit' Co-Authored-By: Nitsan Avni <nitsanav@gmail.com> Co-Authored-By: Susan Fung <38925660+susanfung@users.noreply.github.com> Co-Authored-By: T. E. Green <78671457+Tegsy@users.noreply.github.com> Co-Authored-By: Oliver Bestwalter <263007+obestwalter@users.noreply.github.com>
Throttling of reporters after 5
To avoid too many diff tools being launched, ApprovalTests will stop launching after the 5th time.
This is configurable in
GenericDiffReporter.throttling_threshold
MrJobApprovals accepts options
MrJobApprovals mistakenly did not allow you to pass options, it does not.
This is an api change, hence the minor version bump
Command Line Approvals
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
Command Line Approvals
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
Split approval_utilities
Breaking Change
approval_utilities is becoming its own pypi package to allow usage in production code.
Fixes
You'll have some name spacing changes.
- from approvaltests.utilities.logger ...
+ from approval_utilities.utilities.logger ...
Split approval_utilities
Breaking Change
approval_utilities is becoming its own pypi package to allow usage in production code.
Fixes
You'll have some name spacing changes.
- from approvaltests.utilities.logger ...
+ from approval_utilities.utilities.logger ...
DateScrubber
You can now easily create a date scrubber.
For Example:
verify("created at 03:14:15", options=Options().with_scrubber(DateScrubber.get_scrubber_for("00:00:00")))
will produce
created at <date0>
SimpleLogger log_to_string is thread safe
log_to_string, by default, now will log 1 string per thread. Allowing multithreaded testing
Extra utilities: verify_simple_logger, verify_storyboard, use_utc_timezone
- verify_simple_logger
- verify_storyboard
- use_utc_timezone() - allow easy testing of datetimes by forcing Timezone while in test