summaryrefslogtreecommitdiff
path: root/factory/utils.py
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2016-04-02 16:13:34 +0200
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2016-04-02 17:11:46 +0200
commitc77962de7dd7206ccab85b44da173832acbf5921 (patch)
tree0913b772d5181f654d5ce824753186a2252e9691 /factory/utils.py
parenteea28cce1544021f3d152782c9932a20402d6240 (diff)
downloadfactory-boy-c77962de7dd7206ccab85b44da173832acbf5921.tar
factory-boy-c77962de7dd7206ccab85b44da173832acbf5921.tar.gz
Add a new Params section to factories.
This handles parameters that alter the declarations of a factory. A few technical notes: - A parameter's outcome may alter other parameters - In order to fix that, we perform a (simple) cyclic definition detection at class declaration time. - Parameters may only be either naked values or ComplexParameter subclasses - Parameters are never passed to the underlying class
Diffstat (limited to 'factory/utils.py')
-rw-r--r--factory/utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/factory/utils.py b/factory/utils.py
index 15dba0a..cfae4ec 100644
--- a/factory/utils.py
+++ b/factory/utils.py
@@ -35,7 +35,7 @@ def extract_dict(prefix, kwargs, pop=True, exclude=()):
Args:
prefix (str): the prefix to use for lookups
- kwargs (dict): the dict from which values should be extracted
+ kwargs (dict): the dict from which values should be extracted; WILL BE MODIFIED.
pop (bool): whether to use pop (True) or get (False)
exclude (iterable): list of prefixed keys that shouldn't be extracted
@@ -68,7 +68,7 @@ def multi_extract_dict(prefixes, kwargs, pop=True, exclude=()):
Args:
prefixes (str list): the prefixes to use for lookups
- kwargs (dict): the dict from which values should be extracted
+ kwargs (dict): the dict from which values should be extracted; WILL BE MODIFIED.
pop (bool): whether to use pop (True) or get (False)
exclude (iterable): list of prefixed keys that shouldn't be extracted