Closes #8572: Add a pre_run() method for reports

This commit is contained in:
jeremystretch
2022-02-07 12:57:02 -05:00
parent 733a9bb2e1
commit 049acde5b0
3 changed files with 13 additions and 3 deletions

View File

@@ -226,6 +226,9 @@ class Report(object):
job_result.status = JobResultStatusChoices.STATUS_RUNNING
job_result.save()
# Perform any post-run tasks
self.pre_run()
try:
for method_name in self.test_methods:
@@ -253,8 +256,14 @@ class Report(object):
# Perform any post-run tasks
self.post_run()
def post_run(self):
def pre_run(self):
"""
Extend this method to include any tasks which should execute after the report has been run.
Extend this method to include any tasks which should execute *before* the report is run.
"""
pass
def post_run(self):
"""
Extend this method to include any tasks which should execute *after* the report is run.
"""
pass