def _make_failing_method(self, exc: Exception) -> Callable[..., NoReturn]:
        """Return a function that will raise `exc`."""
        def _meth(*args: Any, **kwargs: Any) -> NoReturn:
            raise exc
        return _meth
Return a function that will raise `exc`.
tests/helpers.py