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

Unleash / unleash-client-python / 15340842425

30 May 2025 06:38AM UTC coverage: 86.567% (-8.9%) from 95.455%
15340842425

Pull #350

github

web-flow
Merge ea5b3045d into f750c8ec9
Pull Request #350: feat: asynchronous support

603 of 736 new or added lines in 20 files covered. (81.93%)

986 of 1139 relevant lines covered (86.57%)

0.87 hits per line

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

70.59
/UnleashClient/asynchronous/loader.py
1
from yggdrasil_engine.engine import UnleashEngine
1✔
2

3
from ..constants import FEATURES_URL
1✔
4
from ..utils import LOGGER
1✔
5
from .cache import AsyncBaseCache
1✔
6

7

8
async def async_load_features(
1✔
9
    cache: AsyncBaseCache,
10
    engine: UnleashEngine,
11
) -> None:
12
    """
13
    Caching
14

15
    :param cache: Should be the cache class variable from UnleashClient
16
    :param feature_toggles: Should be a JSON string containing the feature toggles, equivalent to the response from Unleash API
17
    :return:
18
    """
19
    # Pull raw provisioning from cache.
20
    feature_provisioning = await cache.get(FEATURES_URL)
1✔
21
    if not feature_provisioning:
1✔
22
        LOGGER.warning(
1✔
23
            "Unleash client does not have cached features. "
24
            "Please make sure client can communicate with Unleash server!"
25
        )
26
        return
1✔
27

28
    try:
1✔
29
        warnings = engine.take_state(feature_provisioning)
1✔
30
        if warnings:
1✔
NEW
31
            LOGGER.warning(
×
32
                "Some features were not able to be parsed correctly, they may not evaluate as expected"
33
            )
NEW
34
            LOGGER.warning(warnings)
×
NEW
35
    except Exception as e:
×
NEW
36
        LOGGER.error(f"Error loading features: {e}")
×
NEW
37
        LOGGER.debug(f"Full feature response body from server: {feature_provisioning}")
×
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

© 2026 Coveralls, Inc