Fix: list_generator pass doctests

This commit is contained in:
Bertrand Benjamin 2021-10-06 15:41:35 +02:00
parent 87b6b3ca27
commit 5d909a5f81

View File

@ -47,11 +47,11 @@ def list_generator(var_list:list[str], conditions:list[str]=[], global_config:di
True
>>> c not in [2, 3, 5, 7]
True
>>> a, ab, b, c = list_generator(["a", "a*b", "b", "c"], configs={"a": {"rejected": [2, 3, 5, 7]})
>>> a, ab, b, c = list_generator(["a", "a*b", "b", "c"], configs={"a": {"rejected": [2, 3, 5, 7]}})
>>> a not in [2, 3, 5, 7]
True
"""
rv = extract_letters(var_list)
rv_gen = random_generator(rv, conditions, dict(DEFAUTL_CONFIG, **global_config), variables_scope)
rv_gen = random_generator(rv, conditions, dict(DEFAUTL_CONFIG, **global_config), configs)
generated = eval_words(var_list, rv_gen)
return [generated[v] for v in var_list]