Patch Launch Darkly feature flags for unit testing
- Free software: Apache Software License 2.0
- Documentation: https://ld-feature-patch.readthedocs.io/en/latest/.
from ld_patch import patch_feature
@patch_feature("my.flag.key", True)
def test_my_code():
# Feature defaults to False
show_feature = ldclient.variation(
"my.flag.key",
"test@example.com",
False
)
# But patch_feature set it to True
assert show_feature == True
python -m pip install ld-feature-patch
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.