On Fri, May 22, 2020 at 4:23 AM Steven D'Aprano <steve@pearwood.info> wrote:
In pseudo-code:

- create a temporary file of 2048 bytes;
- write a NTFS file system in that file;
- mount that file system somewhere so it is visible;

So have the test create a new file system on the fly, cd into that file
system, run the test proper, and if it fills up, no harm done.

If that IS doable on all platforms we care about, it could be pretty handy for all kinds of tests that require writing files. yes, in most cases, temp files work fine, but this feels cleaner and easier to make make sure you don't leave any files laying around after your tests.

It would be a handy utility to have available in unit tests in general.

-CHB


--
Christopher Barker, PhD

Python Language Consulting
  - Teaching
  - Scientific Software Development
  - Desktop GUI and Web Development
  - wxPython, numpy, scipy, Cython