Skip to content

Commit

Permalink
. d updated markdown snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Oct 28, 2024
1 parent b871302 commit e3468dc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions approvaltests/approvals.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,12 +411,17 @@ def verify_executable_command(
)


def verify_argument_parser(parser: argparse.ArgumentParser,
*, # enforce keyword arguments - https://www.python.org/dev/peps/pep-3102/
options: Optional[Options] = None) -> None:
def verify_argument_parser(
parser: argparse.ArgumentParser,
*, # enforce keyword arguments - https://www.python.org/dev/peps/pep-3102/
options: Optional[Options] = None,
) -> None:
parser.formatter_class = lambda prog: argparse.HelpFormatter(
prog, max_help_position=100, width=200
)
options = options or Options()
scrubber = lambda t: t.replace("options:", "<optional header>:")
verify( parser.format_help(),options=options.with_scrubber(scrubber),)
verify(
parser.format_help(),
options=options.with_scrubber(scrubber),
)
2 changes: 1 addition & 1 deletion docs/how_to/create_custom_verify_methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def verify_as_json(
options=options.for_file.with_extension(".json"),
)
```
<sup><a href='/approvaltests/approvals.py#L236-L257' title='Snippet source file'>snippet source</a> | <a href='#snippet-verify_as_json' title='Start of snippet'>anchor</a></sup>
<sup><a href='/approvaltests/approvals.py#L237-L258' title='Snippet source file'>snippet source</a> | <a href='#snippet-verify_as_json' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

## Create a `Verifiable` Object
Expand Down

0 comments on commit e3468dc

Please sign in to comment.