misc: pylint fix bare-except (#52630)
This commit is contained in:
parent
7db86a547d
commit
8af3b1374c
|
@ -52,7 +52,7 @@ def test_plaintext_error():
|
||||||
pub._set_request(req)
|
pub._set_request(req)
|
||||||
try:
|
try:
|
||||||
raise Exception('foo')
|
raise Exception('foo')
|
||||||
except:
|
except Exception:
|
||||||
exc_type, exc_value, tb = sys.exc_info()
|
exc_type, exc_value, tb = sys.exc_info()
|
||||||
req.form = {'foo': 'bar'}
|
req.form = {'foo': 'bar'}
|
||||||
assert pub.USE_LONG_TRACES == True # use long traces by default
|
assert pub.USE_LONG_TRACES == True # use long traces by default
|
||||||
|
@ -74,7 +74,7 @@ def test_finish_failed_request():
|
||||||
pub.USE_LONG_TRACES = False
|
pub.USE_LONG_TRACES = False
|
||||||
try:
|
try:
|
||||||
raise Exception('foo')
|
raise Exception('foo')
|
||||||
except:
|
except Exception:
|
||||||
exc_type, exc_value, tb = sys.exc_info()
|
exc_type, exc_value, tb = sys.exc_info()
|
||||||
|
|
||||||
req = get_request()
|
req = get_request()
|
||||||
|
@ -93,7 +93,7 @@ def test_finish_failed_request():
|
||||||
pub._set_request(req)
|
pub._set_request(req)
|
||||||
try:
|
try:
|
||||||
raise Exception()
|
raise Exception()
|
||||||
except:
|
except Exception:
|
||||||
body = pub.finish_failed_request()
|
body = pub.finish_failed_request()
|
||||||
assert 'Traceback (most recent call last)' in str(body)
|
assert 'Traceback (most recent call last)' in str(body)
|
||||||
assert '<div class="error-page">' not in str(body)
|
assert '<div class="error-page">' not in str(body)
|
||||||
|
@ -103,7 +103,7 @@ def test_finish_failed_request():
|
||||||
pub._set_request(req)
|
pub._set_request(req)
|
||||||
try:
|
try:
|
||||||
raise Exception()
|
raise Exception()
|
||||||
except:
|
except Exception:
|
||||||
body = pub.finish_failed_request()
|
body = pub.finish_failed_request()
|
||||||
assert 'Traceback (most recent call last)' in str(body)
|
assert 'Traceback (most recent call last)' in str(body)
|
||||||
assert '<div class="error-page">' in str(body)
|
assert '<div class="error-page">' in str(body)
|
||||||
|
|
|
@ -75,14 +75,14 @@ def test_webservice_auto_sign(http_requests, pub):
|
||||||
wscall.request = {'url': 'http://blah.example.net'}
|
wscall.request = {'url': 'http://blah.example.net'}
|
||||||
try:
|
try:
|
||||||
wscall.call()
|
wscall.call()
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
assert not 'signature=' in http_requests.get_last('url')
|
assert not 'signature=' in http_requests.get_last('url')
|
||||||
|
|
||||||
wscall.request = {'url': 'http://idp.example.net'}
|
wscall.request = {'url': 'http://idp.example.net'}
|
||||||
try:
|
try:
|
||||||
wscall.call()
|
wscall.call()
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
assert 'orig=example.net' in http_requests.get_last('url')
|
assert 'orig=example.net' in http_requests.get_last('url')
|
||||||
assert 'signature=' in http_requests.get_last('url')
|
assert 'signature=' in http_requests.get_last('url')
|
||||||
|
@ -91,7 +91,7 @@ def test_webservice_auto_sign(http_requests, pub):
|
||||||
wscall.request = {'url': ' http://idp.example.net'}
|
wscall.request = {'url': ' http://idp.example.net'}
|
||||||
try:
|
try:
|
||||||
wscall.call()
|
wscall.call()
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
assert 'orig=example.net' in http_requests.get_last('url')
|
assert 'orig=example.net' in http_requests.get_last('url')
|
||||||
assert 'signature=' in http_requests.get_last('url')
|
assert 'signature=' in http_requests.get_last('url')
|
||||||
|
@ -99,7 +99,7 @@ def test_webservice_auto_sign(http_requests, pub):
|
||||||
wscall.request['request_signature_key'] = 'blah'
|
wscall.request['request_signature_key'] = 'blah'
|
||||||
try:
|
try:
|
||||||
wscall.call()
|
wscall.call()
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
assert not 'orig=example.net' in http_requests.get_last('url')
|
assert not 'orig=example.net' in http_requests.get_last('url')
|
||||||
assert 'signature=' in http_requests.get_last('url')
|
assert 'signature=' in http_requests.get_last('url')
|
||||||
|
@ -152,7 +152,7 @@ def test_webservice_post_put_patch(http_requests, pub):
|
||||||
}
|
}
|
||||||
try:
|
try:
|
||||||
wscall.call()
|
wscall.call()
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
assert http_requests.get_last('url') == wscall.request['url']
|
assert http_requests.get_last('url') == wscall.request['url']
|
||||||
assert http_requests.get_last('method') == wscall.request['method']
|
assert http_requests.get_last('method') == wscall.request['method']
|
||||||
|
@ -171,7 +171,7 @@ def test_webservice_delete(http_requests, pub):
|
||||||
}
|
}
|
||||||
try:
|
try:
|
||||||
wscall.call()
|
wscall.call()
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
assert http_requests.get_last('url') == wscall.request['url']
|
assert http_requests.get_last('url') == wscall.request['url']
|
||||||
assert http_requests.get_last('method') == 'DELETE'
|
assert http_requests.get_last('method') == 'DELETE'
|
||||||
|
|
Loading…
Reference in New Issue