From f1bfe57f02e37049f585211d02ed6206f62e4ee8 Mon Sep 17 00:00:00 2001 From: Siddharth Ravikumar Date: Wed, 18 Mar 2015 21:45:58 -0400 Subject: tests/events_test.py: paths in `purge_list' is purged after executing each test method. --- tests/events_test.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/events_test.py b/tests/events_test.py index 1212d69..8c4ff7e 100644 --- a/tests/events_test.py +++ b/tests/events_test.py @@ -333,6 +333,14 @@ class TestEvents(object): if path.exists(silo_path): os.remove(silo_path) + for f in self.purge_list: + if path.exists(f) and path.isfile(f): + os.remove(f) + elif path.exists(f) and path.isdir(f): + purge_dir(f) + os.rmdir(f) + + @classmethod def teardown_class(self): """Purge the mess created by this test""" @@ -348,10 +356,3 @@ class TestEvents(object): rm_nodedirs(self.config) rm_configdir() - - for f in self.purge_list: - if path.exists(f) and path.isfile(f): - os.remove(f) - elif path.exists(f) and path.isdir(f): - purge_dir(f) - os.rmdir(f) -- cgit v1.2.3