Skip to content

Commit

Permalink
Merge pull request #86 from elyezer/proxy-call
Browse files Browse the repository at this point in the history
Remove proxy call from TestFunction
  • Loading branch information
omaciel committed Jan 26, 2016
2 parents fa1c2f4 + 356ffd9 commit 36b8ee8
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions testimony/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ class TestFunction(object):

def __init__(self, function_def, parent_class=None, testmodule=None):
#: A ``ast.FunctionDef`` instance used to extract information
self.docstring = ast.get_docstring(function_def)
self.function_def = function_def
self.name = function_def.name
self.parent_class = parent_class
self.docstring = ast.get_docstring(function_def)
self.testmodule = testmodule
self.assertion = None
self.bugs = None
Expand Down Expand Up @@ -177,14 +178,6 @@ def to_dict(self):
'test': self.test,
}

def __getattr__(self, name):
"""Proxy missing attributes to the ``ast.FunctionDef`` instance."""
attr = getattr(self.function_def, name, self._undefined)
if attr is self._undefined:
return super(TestFunction, self).__getattr__(name)
else:
return attr

def __str__(self):
output = []
if self.test is not None:
Expand Down

0 comments on commit 36b8ee8

Please sign in to comment.