Skip to content

Commit

Permalink
Merge pull request #10 from aismail/405-cleanup-temp-dir
Browse files Browse the repository at this point in the history
405 cleanup temp dir
  • Loading branch information
Andrei-Adnan Ismail committed Oct 7, 2015
2 parents 0fb8016 + b5b20c5 commit 1f95581
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/proxysql_base_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import os.path
import random
import re
import shutil
Expand Down Expand Up @@ -177,14 +178,19 @@ def _populate_proxy_configuration_with_backends(cls):
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
# left them in limbo.
cls._shutdown_docker_services()

try:
shutil.rmtree('/tmp/proxysql-tests/', onerror=cls.onerror)
if os.path.exists('/tmp/proxysql-tests'):
shutil.rmtree('/tmp/proxysql-tests/', onerror=cls.onerror)
except:
pass

Expand Down

0 comments on commit 1f95581

Please sign in to comment.