Skip to content

Commit

Permalink
Run formatter.
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeroIntensity committed Sep 22, 2024
1 parent 54284f4 commit bb8b82c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/_view/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
7 changes: 7 additions & 0 deletions tests/test_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bb8b82c

Please sign in to comment.