From 27d0a915d4a7f56aafc603a949b4e4c36772d236 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Tue, 13 Nov 2018 17:06:03 -0500 Subject: [PATCH] ceph-volume tests update tests to handle new SystemExit exceptions in main Signed-off-by: Alfredo Deza --- src/ceph-volume/ceph_volume/tests/test_main.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ceph-volume/ceph_volume/tests/test_main.py b/src/ceph-volume/ceph_volume/tests/test_main.py index 42fbec155865f..45dcfff851ab8 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 -- 2.39.5