Commit e72bc121 authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[1704] Move test directory creation to setUp() / tearDown()

parent 075eef9a
......@@ -1464,10 +1464,14 @@ class SocketSrvTest(unittest.TestCase):
self.assertTrue(sock.closed)
class TestFunctions(unittest.TestCase):
def test_remove_lock_files(self):
def setUp(self):
if not os.path.isdir(os.environ["LOCKFILE_TESTPATH"]):
os.mkdir(os.environ["LOCKFILE_TESTPATH"])
def tearDown(self):
os.rmdir(os.environ["LOCKFILE_TESTPATH"])
def test_remove_lock_files(self):
if "B10_FROM_BUILD" in os.environ:
oldenv = os.environ["B10_FROM_BUILD"]
else:
......@@ -1493,8 +1497,6 @@ class TestFunctions(unittest.TestCase):
# second call should not assert anyway
bind10_src.remove_lock_files()
os.rmdir(os.environ["LOCKFILE_TESTPATH"])
if oldenv is not None:
os.environ["B10_FROM_BUILD"] = oldenv
else:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment