ceph-volume tests update tests to handle new SystemExit exceptions in main 25101/head
authorAlfredo Deza <adeza@redhat.com>
Tue, 13 Nov 2018 22:06:03 +0000 (17:06 -0500)
committerAlfredo Deza <adeza@redhat.com>
Wed, 14 Nov 2018 18:24:11 +0000 (13:24 -0500)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
(cherry picked from commit 27d0a915d4a7f56aafc603a949b4e4c36772d236)

src/ceph-volume/ceph_volume/tests/test_main.py

index 42fbec155865fe928c79c16db33530f7c7c2a74d..45dcfff851ab87310b0e535fa37b3d4bbd4caaa3 100644 (file)
@@ -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