(name=None)
| 1779 | |
| 1780 | @contextlib.contextmanager |
| 1781 | def _assert_no_warnings_context(name=None): |
| 1782 | __tracebackhide__ = True # Hide traceback for py.test |
| 1783 | with warnings.catch_warnings(record=True) as l: |
| 1784 | warnings.simplefilter('always') |
| 1785 | yield |
| 1786 | if len(l) > 0: |
| 1787 | name_str = f' when calling {name}' if name is not None else '' |
| 1788 | raise AssertionError(f'Got warnings{name_str}: {l}') |
| 1789 | |
| 1790 | |
| 1791 | def assert_no_warnings(*args, **kwargs): |
no outgoing calls
no test coverage detected