On Thu, Feb 14, 2019 at 10:49 AM Ronald Oussoren via Python-Dev <
python-dev@python.org> wrote:

> I usually use shutil.rmtree for tests that need to create temporary files,
> and create a temporary directory for those files (that is, use
> tempfile.mkdtemp in setUp() and use shutil.rmtree in tearDown()). That way
> I don’t have to adjust house-keeping code when I make changes to test code.
>

As tempfile provides context managers, should these be used internally for
something like this? Provide a decorator which passes in the temp file /
directory.

-- 
Joni Orponen
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to