yt.testing.
expand_keywords
(keywords, full=False)[source]¶expand_keywords is a means for testing all possible keyword arguments in the nosetests. Simply pass it a dictionary of all the keyword arguments and all of the values for these arguments that you want to test.
It will return a list of kwargs dicts containing combinations of the various kwarg values you passed it. These can then be passed to the appropriate function in nosetests.
If full=True, then every possible combination of keywords is produced, otherwise, every keyword option is included at least once in the output list. Be careful, by using full=True, you may be in for an exponentially larger number of tests!
- keywords : dict
- a dictionary where the keys are the keywords for the function, and the values of each key are the possible values that this key can take in the function
Returns: | array of dicts :
|
---|
Examples
>>> keywords = {}
>>> keywords['dpi'] = (50, 100, 200)
>>> keywords['cmap'] = ('algae', 'jet')
>>> list_of_kwargs = expand_keywords(keywords)
>>> print list_of_kwargs
>>> list_of_kwargs = expand_keywords(keywords, full=True)
>>> print list_of_kwargs
>>> for kwargs in list_of_kwargs:
... write_projection(*args, **kwargs)