Files
pytest2/_py/test/plugin/pytest_tmpdir.py
holger krekel 5791c06bf2 rewrote the initpkg mechanism and moved py lib implementation files to
_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
2009-10-03 01:47:39 +02:00

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)