Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made test_once a keyword argument in template_tests.utils.setup(). #12850

Merged
merged 1 commit into from
May 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions tests/template_tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
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:

Expand All @@ -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)
Expand Down