diff options
author | holger krekel <holger@merlinux.eu> | 2013-12-07 16:37:46 +0100 |
---|---|---|
committer | holger krekel <holger@merlinux.eu> | 2013-12-07 16:37:46 +0100 |
commit | 4f0879ff9b3e7ad0da1839131c35b4e6412b972f (patch) | |
tree | c9d72163fc3f8bda9565f6dd78649bd9599d8f19 /_pytest/main.py | |
parent | 4b9dbd3920e1aff1e70b221406393f4eabd76056 (diff) | |
download | pytest-4f0879ff9b3e7ad0da1839131c35b4e6412b972f.tar.gz |
refactor internal finalization mechanics such that all fixture arguments
in a test invocation will have a corresponding FixtureDef instance.
also fixes issue246 (again).
simplify parametrized fixture teardown by making it work lazy:
during the setup of a parametrized fixture instance any previously
setup instance which was setup with a different param is torn down
before setting up the new one.
Diffstat (limited to '_pytest/main.py')
-rw-r--r-- | _pytest/main.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/_pytest/main.py b/_pytest/main.py index 48084bab9..75cb487e4 100644 --- a/_pytest/main.py +++ b/_pytest/main.py @@ -230,6 +230,8 @@ class Node(object): #: allow adding of extra keywords to use for matching self.extra_keyword_matches = set() + # used for storing artificial fixturedefs for direct parametrization + self._name2pseudofixturedef = {} #self.extrainit() @property @@ -365,6 +367,8 @@ class Node(object): self.session._setupstate.addfinalizer(fin, self) def getparent(self, cls): + """ get the next parent node (including ourself) + which is an instance of the given class""" current = self while current and not isinstance(current, cls): current = current.parent |