refactor: implement generic optional import mechanisms

this project is actively using optional imports, which leads to
duplicate handling here and there. This commit implements logic in
special method to reduce complexity and simplify tests paths
This commit is contained in:
2026-07-22 16:33:59 +03:00
parent bd26e8da68
commit f37c5bd2a2
16 changed files with 83 additions and 83 deletions
@@ -48,7 +48,8 @@ def test_setup_apispec(application: Application, mocker: MockerFixture) -> None:
must set api specification
"""
apispec_mock = mocker.patch("aiohttp_apispec.setup_aiohttp_apispec")
assert setup_apispec(application)
setup_apispec(application)
apispec_mock.assert_called_once_with(
application,
url="/api-docs/swagger.json",