summaryrefslogtreecommitdiff
path: root/test/units/plugins/lookup
diff options
context:
space:
mode:
authorToshio Kuratomi <a.badger@gmail.com>2018-09-07 17:59:46 -0700
committerToshio Kuratomi <a.badger@gmail.com>2018-12-16 15:03:19 -0800
commit3fba0062078cc04eabb460ec1eb13a4739235199 (patch)
tree9c09103ce103a90f97ccf3736ca6c2502d7860f8 /test/units/plugins/lookup
parent5147e792d398258a5a87c3271ea89c1c4fd2f4d3 (diff)
downloadansible-3fba0062078cc04eabb460ec1eb13a4739235199.tar.gz
Update bare exceptions to specify Exception.
This will keep us from accidentally catching program-exiting exceptions like KeyboardInterupt and SystemExit.
Diffstat (limited to 'test/units/plugins/lookup')
-rw-r--r--test/units/plugins/lookup/test_conjur_variable.py6
-rw-r--r--test/units/plugins/lookup/test_onepassword.py2
2 files changed, 4 insertions, 4 deletions
diff --git a/test/units/plugins/lookup/test_conjur_variable.py b/test/units/plugins/lookup/test_conjur_variable.py
index c2fa87c781..98890f82ab 100644
--- a/test/units/plugins/lookup/test_conjur_variable.py
+++ b/test/units/plugins/lookup/test_conjur_variable.py
@@ -68,7 +68,7 @@ class TestLookupModule:
mock_response = MagicMock(spec_set=http_client.HTTPResponse)
try:
mock_response.getcode.return_value = 200
- except:
+ except Exception:
# HTTPResponse is a Python 3 only feature. This uses a generic mock for python 2.6
mock_response = MagicMock()
mock_response.getcode.return_value = 200
@@ -83,7 +83,7 @@ class TestLookupModule:
mock_response = MagicMock(spec_set=http_client.HTTPResponse)
try:
mock_response.getcode.return_value = 200
- except:
+ except Exception:
# HTTPResponse is a Python 3 only feature. This uses a generic mock for python 2.6
mock_response = MagicMock()
mock_response.getcode.return_value = 200
@@ -99,7 +99,7 @@ class TestLookupModule:
mock_response = MagicMock(spec_set=http_client.HTTPResponse)
try:
mock_response.getcode.return_value = code
- except:
+ except Exception:
# HTTPResponse is a Python 3 only feature. This uses a generic mock for python 2.6
mock_response = MagicMock()
mock_response.getcode.return_value = code
diff --git a/test/units/plugins/lookup/test_onepassword.py b/test/units/plugins/lookup/test_onepassword.py
index 0f67c8bc42..5db40fb78f 100644
--- a/test/units/plugins/lookup/test_onepassword.py
+++ b/test/units/plugins/lookup/test_onepassword.py
@@ -218,7 +218,7 @@ class TestOnePass(unittest.TestCase):
op = MockOnePass()
try:
op.assert_logged_in()
- except:
+ except Exception:
self.fail()
def test_onepassword_logged_out(self):