Tweaked report run logic

This commit is contained in:
Jeremy Stretch
2017-09-21 13:49:04 -04:00
parent 8f1607e010
commit 16d1f9aca8
2 changed files with 30 additions and 14 deletions

View File

@@ -29,12 +29,13 @@ class Report(object):
}
}
"""
results = OrderedDict()
active_test = None
failed = False
def __init__(self):
self.results = OrderedDict()
self.active_test = None
self.failed = False
# Compile test methods and initialize results skeleton
test_methods = []
for method in dir(self):
@@ -92,9 +93,11 @@ class Report(object):
def run(self):
"""
Run the report. Each test method will be executed in order.
Run the report and return its results. Each test method will be executed in order.
"""
for method_name in self.test_methods:
self.active_test = method_name
test_method = getattr(self, method_name)
test_method()
return self.results