• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ets-labs / python-dependency-injector / 3728083530

pending completion
3728083530

push

github-actions

Roman Mogylatov
Merge branch 'release/4.41.0' into master

15 of 15 new or added lines in 2 files covered. (100.0%)

703 of 764 relevant lines covered (92.02%)

0.92 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/dependency_injector/ext/aiohttp.py
1
"""Aiohttp extension module."""
2

3
from __future__ import absolute_import
1✔
4

5
import functools
1✔
6
import warnings
1✔
7

8
from dependency_injector import providers
1✔
9

10

11
warnings.warn(
1✔
12
    'Module "dependency_injector.ext.aiohttp" is deprecated since '
13
    'version 4.0.0. Use "dependency_injector.wiring" module instead.',
14
    category=DeprecationWarning,
15
)
16

17

18
class Application(providers.Singleton):
1✔
19
    """Aiohttp application provider."""
20

21

22
class Extension(providers.Singleton):
1✔
23
    """Aiohttp extension provider."""
24

25

26
class Middleware(providers.DelegatedCallable):
1✔
27
    """Aiohttp middleware provider."""
28

29
    __middleware_version__ = 1
1✔
30

31

32
class MiddlewareFactory(providers.Factory):
1✔
33
    """Aiohttp middleware factory provider."""
34

35

36
class View(providers.Callable):
1✔
37
    """Aiohttp view provider."""
38

39
    def as_view(self):
1✔
40
        """Return aiohttp view function."""
41
        @functools.wraps(self.provides)
1✔
42
        async def _view(request, *args, **kwargs):
1✔
43
            return await self.__call__(request, *args, **kwargs)
1✔
44
        return _view
1✔
45

46

47
class ClassBasedView(providers.Factory):
1✔
48
    """Aiohttp class-based view provider."""
49

50
    def as_view(self):
1✔
51
        """Return aiohttp view function."""
52
        async def _view(request, *args, **kwargs):
1✔
53
            return await self.__call__(request, *args, **kwargs)
1✔
54
        return _view
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc