feat: implement pre_run features in reports

This commit is contained in:
jmanteau 2020-04-25 14:24:51 +02:00 committed by GitHub
parent d8cb58c746
commit 16c52aeb8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -183,6 +183,9 @@ class Report(object):
""" """
self.logger.info(f"Running report") self.logger.info(f"Running report")
# Perform any pre-run tasks
self.pre_run()
for method_name in self.test_methods: for method_name in self.test_methods:
self.active_test = method_name self.active_test = method_name
test_method = getattr(self, method_name) test_method = getattr(self, method_name)
@ -202,6 +205,12 @@ class Report(object):
# Perform any post-run tasks # Perform any post-run tasks
self.post_run() self.post_run()
def pre_run(self):
"""
Extend this method to include any tasks which should execute before the report has been run.
"""
pass
def post_run(self): def post_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 after the report has been run.