"""Conftest""" import pytest from process.utils import features @pytest.fixture(autouse=True) def mock_features(mocker): """Provide tests with a convenient way to mock fetures.""" features_map = {} def _get_flag_value(*args, **kwargs): value = features_map.get(args[0], False) return value def _set_features_map(flags=None): features_map.update(flags or dict()) accnt_mock = mocker.patch.object(features, "is_feature_enabled_for_account") accnt_mock.side_effect = _get_flag_value return _set_features_map