maite.testing.pytest.cleandir#
- maite.testing.pytest.cleandir()[source]#
A pytest fixture that runs a test in a temporary directory as the current working directory.
This is helpful for running tests that require file I/O that could pollute local directories. File cleanup is handled automatically.
- Yields:
- tmpdirnamestr
Temporary directory name that will be removed at fixture teardown
Examples
This assumes that
cleandir
has been imported by the test suite’sconftest.py
file.