A context manager that adds info to an assertion failure.
(msg)
| 607 | |
| 608 | @contextlib.contextmanager |
| 609 | def assertion_context(msg): |
| 610 | """A context manager that adds info to an assertion failure.""" |
| 611 | try: |
| 612 | yield |
| 613 | except AssertionError as exc: |
| 614 | raise AssertionError(f"{msg}: {exc}") |
| 615 | |
| 616 | |
| 617 | def parse_spec_options(opts): |
no outgoing calls