From bb8b82cba79cba04b65230b1a711835bcb1ed6fd Mon Sep 17 00:00:00 2001 From: Peter Bierma Date: Sun, 22 Sep 2024 13:56:16 -0400 Subject: [PATCH] Run formatter. --- src/_view/app.c | 1 - tests/test_functions.py | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/_view/app.c b/src/_view/app.c index b381490..ae9184b 100644 --- a/src/_view/app.c +++ b/src/_view/app.c @@ -1194,7 +1194,6 @@ register_error(ViewApp *self, PyObject *args) } self->error_type = Py_NewRef(type); - printf("a self->error_type: %p\n", self->error_type); Py_RETURN_NONE; } diff --git a/tests/test_functions.py b/tests/test_functions.py index b7abd1c..052684e 100644 --- a/tests/test_functions.py +++ b/tests/test_functions.py @@ -174,17 +174,24 @@ async def other_middleware(call_next: CallNext): async def test_supports_result_isinstance(): + called = 0 + class MyObject(SupportsViewResult): async def __view_result__(self, ctx: Context) -> MaybeAwaitable[ViewResult]: + nonlocal called + called += 1 return "hello" class MyObjectNoInherit: async def __view_result__(self, ctx: Context) -> MaybeAwaitable[ViewResult]: + nonlocal called + called += 1 return "hello" assert isinstance(MyObject(), SupportsViewResult) assert issubclass(MyObject, SupportsViewResult) assert isinstance(MyObjectNoInherit(), SupportsViewResult) + assert called == 2 @pytest.mark.asyncio