disqus / gargoyle

Feature switches in Django
http://engineering.disqus.com
Apache License 2.0
746 stars 112 forks source link

SwitchContextManager doesn't work with hierarchical switches #34

Open mbox opened 12 years ago

mbox commented 12 years ago

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.

acdha commented 11 years ago

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

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