Skip to content

Commit

Permalink
Fix teardown for integration tests.
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Nephin <[email protected]>
  • Loading branch information
dnephin committed May 9, 2015
1 parent 1748b0f commit 915dcb4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/integration/cli_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ def tearDown(self):
sys.exit = self.old_sys_exit
self.project.kill()
self.project.remove_stopped()
for container in self.project.containers(stopped=True, one_off=True):
container.remove(force=True)

@property
def project(self):
Expand Down Expand Up @@ -62,6 +64,10 @@ def test_ps_default_composefile(self, mock_stdout):

@patch('sys.stdout', new_callable=StringIO)
def test_ps_alternate_composefile(self, mock_stdout):
config_path = os.path.abspath(
'tests/fixtures/multiple-composefiles/compose2.yml')
self._project = self.command.get_project(config_path)

self.command.base_dir = 'tests/fixtures/multiple-composefiles'
self.command.dispatch(['-f', 'compose2.yml', 'up', '-d'], None)
self.command.dispatch(['-f', 'compose2.yml', 'ps'], None)
Expand Down Expand Up @@ -416,7 +422,6 @@ def test_scale(self):
self.assertEqual(len(project.get_service('another').containers()), 0)

def test_port(self):

self.command.base_dir = 'tests/fixtures/ports-composefile'
self.command.dispatch(['up', '-d'], None)
container = self.project.get_service('simple').get_container()
Expand Down

0 comments on commit 915dcb4

Please sign in to comment.