瀏覽代碼

Merge pull request #3748 from ijc25/master

tearDown the project override at the end of each test case
Aanand Prasad 9 年之前
父節點
當前提交
26b819ca67
共有 2 個文件被更改,包括 6 次插入0 次删除
  1. 2 0
      tests/acceptance/cli_test.py
  2. 4 0
      tests/integration/testcases.py

+ 2 - 0
tests/acceptance/cli_test.py

@@ -114,6 +114,8 @@ class CLITestCase(DockerClientTestCase):
             for n in networks:
                 if n['Name'].startswith('{}_'.format(self.project.name)):
                     self.client.remove_network(n['Name'])
+        if hasattr(self, '_project'):
+            del self._project
 
         super(CLITestCase, self).tearDown()
 

+ 4 - 0
tests/integration/testcases.py

@@ -63,6 +63,10 @@ class DockerClientTestCase(unittest.TestCase):
 
         cls.client = docker_client(Environment(), version)
 
+    @classmethod
+    def tearDownClass(cls):
+        del cls.client
+
     def tearDown(self):
         for c in self.client.containers(
                 all=True,