_py/... with py/__init__.py containing pointers into them The new apipkg is only around 70 lines of code and allows us to get rid of the infamous "py.__." by regular non-magical "_py." imports. It is also available as a separately installable package, see http://bitbucket.org/hpk42/apipkg --HG-- branch : trunk
17 lines
338 B
Python
17 lines
338 B
Python
"""
|
|
provide temporary directories to test functions and methods.
|
|
|
|
example:
|
|
|
|
pytest_plugins = "pytest_tmpdir"
|
|
|
|
def test_plugin(tmpdir):
|
|
tmpdir.join("hello").write("hello")
|
|
|
|
"""
|
|
import py
|
|
|
|
def pytest_funcarg__tmpdir(request):
|
|
name = request.function.__name__
|
|
return request.config.mktemp(name, numbered=True)
|