Closed
Description
Opened as of discussion in #26818.
tests/io/test_pytables.py
uses a context manager called ensure_clean_path
. It might be worth using the pytest tmp_path
fixture instead which I think provides everything we need with less code (also easier to understand for new contributors familiar with pytest). And it provides even a little more functionality, comparison:
- it guarantees file system isolation between tests (as does
ensure_clean_path
). - it makes it obvious which file belongs to which test via expressive naming (as opposed to
ensure_clean_path
). - it retains files for later inspection as opposed to
ensure_clean_path
. That can be useful for debugging after test failure.
Note: the pytest-managed temp files are removed in a rolling fashion across test runner invocations so that storage space requirement does not grow indefinitely with the number of invocations.
Cf. comment #26818 (comment)