nicely for common tedious causes of skipping: import a module and checking it has a certain version. usage example: docutils = py.test.importorskip(docutils, minversion="0.4") * used new helper and cleanup skipping logic in py lib --HG-- branch : trunk
12 lines
267 B
Python
12 lines
267 B
Python
import py
|
|
|
|
pydir = py.path.local(py.__file__).dirpath()
|
|
mydatadir = py.magic.autopath().dirpath().join("data")
|
|
|
|
def getdata():
|
|
rel = mydatadir.relto(pydir)
|
|
tmpdir = py.test.ensuretemp(rel.replace(pydir.sep, '_'))
|
|
mydatadir.copy(tmpdir)
|
|
return tmpdir
|
|
|