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

nocarryr / tslumd / 5833948469

pending completion
5833948469

push

github

nocarryr
Use pytest_asyncio.fixture for teardown fixtures

841 of 897 relevant lines covered (93.76%)

2.81 hits per line

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

57.14
/src/tslumd/utils.py
1
try:
3✔
2
    import loguru
3✔
3
    from loguru import logger
×
4
except ImportError: # pragma: no cover
5
    loguru = None
6
    import logging
7
    logger = logging.getLogger(__name__)
8
import functools
3✔
9
import inspect
3✔
10

11
if loguru is not None:
3✔
12
    logger_catch = logger.catch
×
13
else:
14
    def logger_catch(f):
3✔
15
        if inspect.iscoroutinefunction(f):
3✔
16
            @functools.wraps(f)
3✔
17
            async def wrapper(*args, **kwargs):
2✔
18
                try:
3✔
19
                    return await f(*args, **kwargs)
3✔
20
                except Exception as exc:
×
21
                    logger.exception(exc)
×
22
                    # raise
23
        else:
24
            @functools.wraps(f)
×
25
            def wrapper(*args, **kwargs):
26
                try:
×
27
                    f(*args, **kwargs)
×
28
                except Exception as exc:
×
29
                    logger.error(f'Error in {f!r}', exc_info=True)
×
30
        return wrapper
3✔
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