Skip to content

Commit

Permalink
Cleaning up some unneeded lines. Commenting
Browse files Browse the repository at this point in the history
  • Loading branch information
rv-kip committed Dec 1, 2016
1 parent c7a195f commit d5a724e
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions nose_annotator/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,14 @@ def configure(self, options, conf):
if not self.enabled:
return

def begin(self):
pass

def startTest(self, test):
"""Collect any annotations for this testcase"""
self.test_class, self.test_name = self.get_test_class_name(test)
self.annotations = self.get_test_annotations(test)
self.result = {}

def stopTest(self, test):
"""Atomically write out annotations to appropriate mapping file"""
if self.annotations and len(self.annotations):
test_class, test_name = self.get_test_class_name(test)
for annotation in self.annotations:
Expand All @@ -48,10 +47,9 @@ def stopTest(self, test):
f.write('%s:%s,%s' % (test_class, test_name, value) + "\n")

def get_test_annotations(self, test):
test_name = test.id().split('.')[-1]
test_method = getattr(test.test, test_name, None)
annotation = getattr(test_method, KEY, None)
return annotation
test_method = getattr(test.test, self.test_name, None)
annotations = getattr(test_method, KEY, None)
return annotations

def get_test_class_name(self, test):
test_class = test.id().split('.')[-2]
Expand Down

0 comments on commit d5a724e

Please sign in to comment.