Skip to content

Releases: approvals/ApprovalTests.Python

Exceptions and Help messages on duplicate verify() calls.

15 Oct 20:22
Compare
Choose a tag to compare

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`

27 Aug 19:48
Compare
Choose a tag to compare

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:

  1. Rename the .txt files to .json
  2. Move them over in your diff tool
  3. Use ReporterThatAutomaticallyApproves
    verify_as_json(result, options=Options().with_reporter(ReporterThatAutomaticallyApproves()))
  4. 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()

16 Jul 18:36
Compare
Choose a tag to compare

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()

16 Jul 18:12
Compare
Choose a tag to compare

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

02 Jul 10:58
Compare
Choose a tag to compare

Added executable commands, plus fixed bugs with import statements

Lint fixes

26 Mar 17:55
Compare
Choose a tag to compare

Removed all linting errors

More version fixes

14 Mar 14:58
Compare
Choose a tag to compare

please work!

Version Egg info issues

14 Mar 14:50
Compare
Choose a tag to compare

fixed for real this time. Double pinky swear.

Release config bug fixes

14 Mar 14:14
Compare
Choose a tag to compare

Fixes

  • #138 setup.py egg_info in ApprovalUtilities
  • import issues in version

Make it possible to find version.py file

12 Mar 18:30
Compare
Choose a tag to compare