[Python-Dev] Tests failing on Windows with TESTFN

Chris Jerdonek chris.jerdonek at gmail.com
Sat Jul 28 21:12:35 EDT 2018


On Sat, Jul 28, 2018 at 5:40 PM Brett Cannon <brett at python.org> wrote:

>
> On Sat, Jul 28, 2018, 15:13 eryk sun, <eryksun at gmail.com> wrote:
>
>> On Sat, Jul 28, 2018 at 9:17 PM, Jeremy Kloth <jeremy.kloth at gmail.com>
>> wrote:
>> >
>> > *PLEASE*, don't use tempfile to create files/directories in tests.  It
>> > is unfriendly to (Windows) buildbots.  The current approach of
>> > directory-per-process ensures no test turds are left behind, whereas
>> > the tempfile solution slowly fills up my buildbot.  Windows doesn't
>> > natively clean out the temp directory.
>>
>> FYI, Windows 10 storage sense (under system->storage) can be
>> configured to delete temporary files on a schedule. Of course that
>> doesn't help with older systems.
>>
>
> If Windows doesn't clean up its temp directory on a regular basis then
> that doesn't suggest to me not to use tempfile, but instead that the use of
> tempfile still needs to clean up after itself. And if there is a lacking
> feature in tempfile then we should add it instead of a avoiding the module.
>

Regardless of whether the tempfile or TESTFN approach is used, I think it
would be best for a few reasons if the choice is abstracted behind a
uniquely named test function (e.g. make_test_file if not already used).

—Chris



> -Brett
>
> _______________________________________________
>> Python-Dev mailing list
>> Python-Dev at python.org
>> https://mail.python.org/mailman/listinfo/python-dev
>>
> Unsubscribe:
>> https://mail.python.org/mailman/options/python-dev/brett%40python.org
>>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> https://mail.python.org/mailman/options/python-dev/chris.jerdonek%40gmail.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20180728/1f9a12ea/attachment.html>


More information about the Python-Dev mailing list