Skip to content
Snippets Groups Projects
Commit 7018506e authored by mham's avatar mham
Browse files

adding cleanup method

parent cbe4a2ce
No related branches found
No related tags found
No related merge requests found
Pipeline #18200 passed
...@@ -300,7 +300,7 @@ class EllipSysTestCase(object): ...@@ -300,7 +300,7 @@ class EllipSysTestCase(object):
self.casedict['directory'])): self.casedict['directory'])):
raise unittest.SkipTest('Testcase directory not found') raise unittest.SkipTest('Testcase directory not found')
case = CaseRunner(self.casedict) self.case = case = CaseRunner(self.casedict)
if 'casename' not in self.casedict.keys(): if 'casename' not in self.casedict.keys():
case.casename = self.__class__.__name__.split('.')[-1] case.casename = self.__class__.__name__.split('.')[-1]
case.run_case() case.run_case()
...@@ -346,3 +346,17 @@ class EllipSysTestCase(object): ...@@ -346,3 +346,17 @@ class EllipSysTestCase(object):
np.testing.assert_allclose(expected, result, np.testing.assert_allclose(expected, result,
rtol=10**(-case.tol), rtol=10**(-case.tol),
atol=10**(-case.tol)) atol=10**(-case.tol))
def tearDown(self):
"""Clears the test folder before test machine loads to cache.
"""
# get directory
testroot = '/'.join(self.case.directory.split('/')[:-1])
test_dir = os.path.join(testroot, self.case.casename)
if os.path.exists(test_dir):
print('removing test data')
os.system('ls -a *')
shutil.rmtree(test_dir)
os.system('ls -a *')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment