provide temporary directories to test functions.

usage example:

def test_plugin(tmpdir):
    tmpdir.join("hello").write("hello")

the 'tmpdir' test function argument

return a temporary directory path object unique to each test function invocation, created as a sub directory of the base temporary directory. The returned object is a py.path.local path object.

Start improving this plugin in 30 seconds

  1. Download pytest_tmpdir.py plugin source code
  2. put it somewhere as pytest_tmpdir.py into your import path
  3. a subsequent py.test run will use your local version

Checkout customize, other plugins or get in contact.