def try_render(
        self,
        text: str,
        ctx: dict[str, Any] | None = None,
        result: str | None = None,
    ) -> None:
        """Render `text` through `ctx`, and it had better be `result`.

        Result defaults to None so we can shorten the calls where we expect
        an exception and never get to the result comparison.

        """
        actual = Templite(text).render(ctx or {})
        # If result is None, then an exception should have prevented us getting
        # to here.
        assert result is not None
        assert actual == result
Render `text` through `ctx`, and it had better be `result`.

        Result defaults to None so we can shorten the calls where we expect
        an exception and never get to the result comparison.

        
tests/test_templite.py