summaryrefslogtreecommitdiff
path: root/tests/template_tests/utils.py
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2020-05-03 07:13:38 -0700
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-05-21 08:09:19 +0200
commit81d69568a675f0fb7f66b9c898dc7fb42f967d58 (patch)
treeb754456cdae6d21a3071ac45390e41cafdf4cfde /tests/template_tests/utils.py
parent4484bc1b2f84da6442c9c2bfd95d3f1f7d8f96f7 (diff)
Made test_once a keyword argument in template_tests.utils.setup().
Replaces the kwargs.get(...) pattern. Helps avoid typos by providing a better error message in case of misuse.
Diffstat (limited to 'tests/template_tests/utils.py')
-rw-r--r--tests/template_tests/utils.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/template_tests/utils.py b/tests/template_tests/utils.py
index 66a173396c..ad77eae1dd 100644
--- a/tests/template_tests/utils.py
+++ b/tests/template_tests/utils.py
@@ -9,7 +9,7 @@ ROOT = os.path.dirname(os.path.abspath(__file__))
TEMPLATE_DIR = os.path.join(ROOT, 'templates')
-def setup(templates, *args, **kwargs):
+def setup(templates, *args, test_once=False):
"""
Runs test method multiple times in the following order:
@@ -21,10 +21,10 @@ def setup(templates, *args, **kwargs):
False True INVALID
True False
True True
+
+ Use test_once=True to test deprecation warnings since the message won't be
+ displayed multiple times.
"""
- # when testing deprecation warnings, it's useful to run just one test since
- # the message won't be displayed multiple times
- test_once = kwargs.get('test_once', False)
for arg in args:
templates.update(arg)