From: Alfredo Deza Date: Tue, 13 Nov 2018 22:06:03 +0000 (-0500) Subject: ceph-volume tests update tests to handle new SystemExit exceptions in main X-Git-Tag: v13.2.3~55^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f7d501a7a80dc21ca9091d80163c7f6b2ea8dd1c;p=ceph.git ceph-volume tests update tests to handle new SystemExit exceptions in main Signed-off-by: Alfredo Deza (cherry picked from commit 27d0a915d4a7f56aafc603a949b4e4c36772d236) --- diff --git a/src/ceph-volume/ceph_volume/tests/test_main.py b/src/ceph-volume/ceph_volume/tests/test_main.py index 42fbec155865..45dcfff851ab 100644 --- a/src/ceph-volume/ceph_volume/tests/test_main.py +++ b/src/ceph-volume/ceph_volume/tests/test_main.py @@ -6,18 +6,21 @@ from ceph_volume import main class TestVolume(object): def test_main_spits_help_with_no_arguments(self, capsys): - main.Volume(argv=[]) + with pytest.raises(SystemExit): + main.Volume(argv=[]) stdout, stderr = capsys.readouterr() assert 'Log Path' in stdout def test_warn_about_using_help_for_full_options(self, capsys): - main.Volume(argv=[]) + with pytest.raises(SystemExit): + main.Volume(argv=[]) stdout, stderr = capsys.readouterr() assert 'See "ceph-volume --help" for full list' in stdout def test_environ_vars_show_up(self, capsys): os.environ['CEPH_CONF'] = '/opt/ceph.conf' - main.Volume(argv=[]) + with pytest.raises(SystemExit): + main.Volume(argv=[]) stdout, stderr = capsys.readouterr() assert 'CEPH_CONF' in stdout assert '/opt/ceph.conf' in stdout