Package schrodinger :: Package test :: Module decorate_fflag :: Class enable_feature_flag
[hide private]
[frames] | no frames]

Class enable_feature_flag

                           object --+    
                                    |    
infra.util.DecoratorAndContextManager --+
                                        |
                                       enable_feature_flag
Known Subclasses:

Provides a decorator/context manager for enabling feature flags. Methods are named to allow this to be used the same ways as Mock's patches:

   * As context manager
   * As function or test class decorator
   * Explicit start and stop.
Instance Methods [hide private]
 
__init__(self, flag)
x.__init__(...) initializes x; see help(type(x)) for signature
 
start(self)
Starts the patching.
 
stop(self)
Stops the patching.
 
_onstr(self, on=False)
Return the +/- representation of a boolean value.
 
_set_ff(self, flagname, flagstr, on=True)
Create the featureflag environment variable string.
 
__enter__(self)
Enter the context manager.
 
__exit__(self, exc_type, exc_value, traceback)
Exit the context manager.

Inherited from infra.util.DecoratorAndContextManager: __call__, decorate

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  on = 1
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, flag)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

start(self)

 

Starts the patching. Used both in the decorator and the context manager.

stop(self)

 

Stops the patching. Used both in the decorator context and the context manager context.

__enter__(self)

 

Enter the context manager.

Overrides: infra.util.DecoratorAndContextManager.__enter__

__exit__(self, exc_type, exc_value, traceback)

 

Exit the context manager.

Overrides: infra.util.DecoratorAndContextManager.__exit__