#405 Making sure that /tmp/proxysql-tests actually exists before trying to delete it

.. and also logging the delete error better
pull/408/head^2
Andrei-Adnan Ismail 11 years ago
parent 0fb8016a88
commit 272d261505

@ -1,4 +1,5 @@
import os
import os.path
import random
import re
import shutil
@ -177,6 +178,10 @@ class ProxySQLBaseTest(TestCase):
cursor.close()
proxy_admin_connection.close()
@classmethod
def onerror(cls, function, path, excinfo):
print("Error while trying to delete %s: %r" % (path, excinfo))
@classmethod
def setUpClass(cls):
# Always shutdown docker services because the previous test might have
@ -185,6 +190,7 @@ class ProxySQLBaseTest(TestCase):
try:
shutil.rmtree('/tmp/proxysql-tests/', onerror=cls.onerror)
if os.path.exists('/tmp/proxysql-tests'):
except:
pass

Loading…
Cancel
Save