def tempdir(): """py.test fixture to create a temporary folder for a test.""" with testfixtures.TempDirectory(create=True) as d: yield d d.cleanup()