[svn r40702] (pedronis, arigo)
Add setup/teardown calls around generators, with the same semantics as around functions and methods. --HG-- branch : trunk
This commit is contained in:
@@ -442,7 +442,9 @@ class Instance(PyCollectorMixin, Collector):
|
||||
Collector.Function.__get__(self)) # XXX for python 2.2
|
||||
Function = property(Function)
|
||||
|
||||
class Generator(PyCollectorMixin, Collector):
|
||||
from py.__.test.item import FunctionMixin # XXX import order issues :-(
|
||||
|
||||
class Generator(FunctionMixin, PyCollectorMixin, Collector):
|
||||
def run(self):
|
||||
self._prepare()
|
||||
itemlist = self._name2items
|
||||
@@ -468,13 +470,6 @@ class Generator(PyCollectorMixin, Collector):
|
||||
call, args = obj, ()
|
||||
return call, args
|
||||
|
||||
def _getpathlineno(self):
|
||||
code = py.code.Code(self.obj)
|
||||
return code.path, code.firstlineno
|
||||
|
||||
def _getsortvalue(self):
|
||||
return self._getpathlineno()
|
||||
|
||||
class DoctestFile(PyCollectorMixin, FSCollector):
|
||||
def run(self):
|
||||
return [self.fspath.basename]
|
||||
|
||||
Reference in New Issue
Block a user