Releases: approvals/ApprovalTests.Python
Exceptions and Help messages on duplicate verify() calls.
ApprovalTests only wants one call to verify() per test.
There are ways to go around this but if you call verify where it would want the exact same file name twice, it will now throw an exception.
This will make it easier for people to not be confused as most other testing frameworks allow you to put multiple assertions in the same test.
Backwards compatibility
There are some situations where you want to check that two different processes produce the same result.
Calling verify multiple times in the same test can be a way to do this.
If you want to do that, we have provided the following:
approvals.settings().allow_multiple_verify_calls_for_this_method()
`verify_as_json()` creates `.json` files instead of `.txt`
verify_as_json()
creates .json
files instead of .txt
This is a BREAKING CHANGE.
There are two ways to fix this.
1. re-approve the .json
files
Either:
- Rename the
.txt
files to.json
- Move them over in your diff tool
- Use
ReporterThatAutomaticallyApproves
verify_as_json(result, options=Options().with_reporter(ReporterThatAutomaticallyApproves()))
- Use
ReporterByCopyMoveCommandForEverythingToClipboard
+ paste into your terminal
verify_as_json(result, options=Options().with_reporter(ReporterByCopyMoveCommandForEverythingToClipboard()))
2. Keep your .txt
files backwards compatible
verify_as_json(result, options=Options().for_file.with_extension(".txt"))
verify_logging()
Allows for easy testing of the standard python logging library.
def test_basic_logging():
with verify_logging():
logging.info("1")
logging.info(datetime.now())
Also, small bug fix where scrubbers where being replaced instead of added to
verify_logging()
Allows for easy testing of the standard python logging library.
def test_basic_logging():
with verify_logging():
logging.info("1")
logging.info(datetime.now())
executable commands
Added executable commands, plus fixed bugs with import statements
Lint fixes
Removed all linting errors
More version fixes
please work!
Version Egg info issues
fixed for real this time. Double pinky swear.
Release config bug fixes
Fixes
- #138 setup.py egg_info in ApprovalUtilities
- import issues in version
Make it possible to find version.py file
Fixes Issue #134