On Fri, May 22, 2020 at 4:23 AM Steven D'Aprano <[email protected]> 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
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/ZWJT7VO3OCLAQ6RZWIL5IZMA7ZM2YUQD/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to