tests(cli): Create a temp test workspace only once

Do not re-create it for every test in the class.
This commit is contained in:
Adrien Vergé 2017-06-28 13:30:12 +02:00
parent 7d638d47b9
commit 342d7b49dd

View File

@ -32,8 +32,11 @@ from tests.common import build_temp_workspace
class CommandLineTestCase(unittest.TestCase):
def setUp(self):
self.wd = build_temp_workspace({
@classmethod
def setUpClass(cls):
super(CommandLineTestCase, cls).setUpClass()
cls.wd = build_temp_workspace({
# .yaml file at root
'a.yaml': '---\n'
'- 1 \n'
@ -63,8 +66,11 @@ class CommandLineTestCase(unittest.TestCase):
u'# الأَبْجَدِيَّة العَرَبِيَّة\n').encode('utf-8'),
})
def tearDown(self):
shutil.rmtree(self.wd)
@classmethod
def tearDownClass(cls):
super(CommandLineTestCase, cls).tearDownClass()
shutil.rmtree(cls.wd)
def test_find_files_recursively(self):
self.assertEqual(