gargoyle icon indicating copy to clipboard operation
gargoyle copied to clipboard

SwitchContextManager doesn't work with hierarchical switches

Open mbox opened this issue 12 years ago • 1 comments

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.

mbox avatar Apr 02 '12 08:04 mbox

I just ran into this & ended up using mock.patch to force the values I needed:

@patch("gargoyle.gargoyle.is_active", return_value=False)

acdha avatar Aug 27 '12 15:08 acdha