gargoyle
gargoyle copied to clipboard
SwitchContextManager doesn't work with hierarchical switches
The syntax for SwitchContextManager is with switches(my_switch_name=True):, which requires my_switch_name to be a valid Python identifier.
Hierarchical switches use ":" to separate path components - which isn't a valid character in an identifier.
I just ran into this & ended up using mock.patch to force the values I needed:
@patch("gargoyle.gargoyle.is_active", return_value=False)