<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div class="">
<div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;">—</div><div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;"><br class=""></div><div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;">Twitter: @ronaldoussoren</div><div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;">Blog: <a href="https://blog.ronaldoussoren.net/" class="">https://blog.ronaldoussoren.net/</a></div>
</div>
<div><br class=""><blockquote type="cite" class=""><div class="">On 13 Feb 2019, at 16:10, Giampaolo Rodola' <<a href="mailto:g.rodola@gmail.com" class="">g.rodola@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div dir="ltr" class=""><br class=""></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 13, 2019 at 2:27 PM Ronald Oussoren <<a href="mailto:ronaldoussoren@mac.com" class="">ronaldoussoren@mac.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;" class=""><div class=""><br class="">
</div>
<div class=""><br class=""><blockquote type="cite" class=""><div class="">On 13 Feb 2019, at 13:24, Giampaolo Rodola' <<a href="mailto:g.rodola@gmail.com" target="_blank" class="">g.rodola@gmail.com</a>> wrote:</div><br class="gmail-m_-7115396755505717611Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><br class="">Hello,<br class="">after discovering os.makedirs() has no unit-tests (<a href="https://bugs.python.org/issue35982" target="_blank" class="">https://bugs.python.org/issue35982</a>) I was thinking about working on a PR to increase the test coverage of fs-related os.* functions. In order to do so I think it would be useful to add a convenience function to "just delete something if it exists", regardless if it's a file, directory, directory tree, etc., and include it into test.support module. </div></div></div></div></blockquote><div class=""><br class=""></div><div class="">Something like shutil.rmtree() with ignore_errors=True?</div></div></div></blockquote><div class=""><br class=""></div><div class="">shutil.rmtree() is about directories and can't be used against files. support.rmpath() would take a path (meaning anything) and try to remove it.<br class=""></div></div></div></div></blockquote><div><br class=""></div>You’re right.  </div><div><br class=""></div><div>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.</div><div><br class=""></div><div>Ronald</div><div><br class=""></div></body></html>