Files
pytest2/py/test/dsession/testing/basetest.py
hpk abc8cf09aa [svn r57321] merging the event branch:
* moving in test, misc, code, io directories and
  py/__init__.py
* py/bin/_find.py does not print to stderr anymore
* a few fixes to conftest files in other dirs
some more fixes and adjustments pending

--HG--
branch : trunk
2008-08-16 17:26:59 +02:00

33 lines
953 B
Python

""" Support module for running tests
"""
import py
from py.__.test.testing.setupdata import getexamplefile
class DirSetup(object):
def setup_method(self, method):
name = "%s.%s" %(self.__class__.__name__, method.func_name)
self.tmpdir = py.test.ensuretemp(name)
self.source = self.tmpdir.ensure("source", dir=1)
self.dest = self.tmpdir.join("dest")
class BasicRsessionTest(object):
def setup_class(cls):
path = getexamplefile("funcexamples.py")
cls.config = py.test.config._reparse([path.dirpath()])
cls.modulecol = cls.config.getfsnode(path)
def setup_method(self, method):
self.session = self.config.initsession()
def getfunc(self, name):
funcname = "func" + name
col = self.modulecol.join(funcname)
assert col is not None, funcname
return col
def getdocexample(self):
return getexamplefile("docexample.txt")