summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/support.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/support.py b/Lib/test/support.py
index 08828a8..e3a3b38 100644
--- a/Lib/test/support.py
+++ b/Lib/test/support.py
@@ -365,6 +365,10 @@ else:
'Unicode filename tests may not be effective'
% TESTFN_UNICODE_UNENCODEABLE)
+if os.path.isdir(TESTFN):
+ # a test failed (eg. test_os) without removing TESTFN directory
+ shutil.rmtree(TESTFN)
+
# Make sure we can write to TESTFN, try in /tmp if we can't
fp = None
try: