Skip to content

Releases: approvals/ApprovalTests.Python

py.typed

17 Nov 17:54
Compare
Choose a tag to compare
  • add py.typed to appease mypy ( #184 resolves #179 )
  • fix typo in use_utc_timezone

verify_argument_parser

28 Oct 19:24
Compare
Choose a tag to compare

Added verify_argument_parser for python arg_parse configuration.

Example:

    verify_argument_parser(parser)

Produces

usage: my_program.py [-h] [--optional_argument OPTIONAL_ARGUMENT] 1st_argument long_argument

My Description

positional arguments:
 1st_argument          1st argument help text


<optional header>:
 -h, --help            show this help message and exit
 --optional_argument OPTIONAL_ARGUMENT
                       An Optional Argument help text

Moved mrjob to integrations.mrjob

07 Jul 19:25
Compare
Choose a tag to compare

also moved to prevent a pycharm bug where top level names collide

Moved pytest to integrations.pytest

07 Jul 19:20
Compare
Choose a tag to compare

To fix an odd bug in PyCharm with top-level pytest folders over-write defaults.

fix import from inline.parse

09 Jun 19:12
9ad7963
Compare
Choose a tag to compare

InlineOptions.semi_automatic_with_previous_approved()

19 May 19:33
Compare
Choose a tag to compare

Will produce the following doc_string approval:

    """
    42
    ***** DELETE ME TO APPROVE *****
    vvvvv PREVIOUS RESULT vvvvv
    41
    """

Options().add_reporter(r)

12 May 18:22
Compare
Choose a tag to compare

You can now add a reporter and both the previous and the new will launch. This is extra helpful with inline approvals

Inline approvals uses `InlineOptions`

28 Apr 19:49
Compare
Choose a tag to compare

BREAKING CHANGE

verify(result, options=Options().inline(show_code=False))
verify(result, options=Options().inline(show_code=True))

is now

verify(result, options=Options().inline(InlineOptions.show_code(False)))
verify(result, options=Options().inline())

New Features in Inline Approvals

Semi-automatic Workflow

verify(result, options=Options().inline(InlineOptions.semi_automatic()))

In this workflow, the docstring will be automatically updated, but with an extra line to be removed as approval.

Example:

Running this test:

def test_with_semi_automatic_inline_workflow():
    verify("1\n2", options=Options().inline(InlineOptions.semi_automatic()))

Will automatically update the test source file to:

def test_with_semi_automatic_inline_workflow():
   """
   1
   2
   ***** DELETE ME TO APPROVE *****
   """
    verify("1\n2", options=Options().inline(InlineOptions.semi_automatic()))

And as the last line suggests, when it is removed the test will start passing.

Fully Automatic Workflow

With this workflow, the extra line is not added.

def test_with_automatic_inline_workflow():
    verify("1\n2", options=Options().inline(InlineOptions.automatic()))

Becomes:

def test_with_automatic_inline_workflow():
   """
   1
   2
   """
    verify("1\n2", options=Options().inline(InlineOptions.automatic()))

Bug Fixes

Fix #159: would sometimes report approved and received as matching when they weren't. This usually only happened on cyberdojo with inline approvals,

link to approval-utilities

13 Apr 01:12
Compare
Choose a tag to compare
v11.2.1

d updated markdown snippets

Parse for Inline Approvals

07 Apr 18:43
Compare
Choose a tag to compare

Utilities to make it much easier to rapidly develop tests
Read the How To