Projet

Général

Profil

0004-misc-pylint-fix-bare-except-52630.patch

Lauréline Guérin, 02 avril 2021 17:21

Télécharger (3,61 ko)

Voir les différences:

Subject: [PATCH 04/18] misc: pylint fix bare-except (#52630)

 tests/test_publisher.py |  8 ++++----
 tests/test_wscall.py    | 12 ++++++------
 2 files changed, 10 insertions(+), 10 deletions(-)
tests/test_publisher.py
52 52
    pub._set_request(req)
53 53
    try:
54 54
        raise Exception('foo')
55
    except:
55
    except Exception:
56 56
        exc_type, exc_value, tb = sys.exc_info()
57 57
    req.form = {'foo': 'bar'}
58 58
    assert pub.USE_LONG_TRACES == True  # use long traces by default
......
74 74
    pub.USE_LONG_TRACES = False
75 75
    try:
76 76
        raise Exception('foo')
77
    except:
77
    except Exception:
78 78
        exc_type, exc_value, tb = sys.exc_info()
79 79

  
80 80
    req = get_request()
......
93 93
    pub._set_request(req)
94 94
    try:
95 95
        raise Exception()
96
    except:
96
    except Exception:
97 97
        body = pub.finish_failed_request()
98 98
        assert 'Traceback (most recent call last)' in str(body)
99 99
        assert '<div class="error-page">' not in str(body)
......
103 103
    pub._set_request(req)
104 104
    try:
105 105
        raise Exception()
106
    except:
106
    except Exception:
107 107
        body = pub.finish_failed_request()
108 108
        assert 'Traceback (most recent call last)' in str(body)
109 109
        assert '<div class="error-page">' in str(body)
tests/test_wscall.py
75 75
    wscall.request = {'url': 'http://blah.example.net'}
76 76
    try:
77 77
        wscall.call()
78
    except:
78
    except Exception:
79 79
        pass
80 80
    assert not 'signature=' in http_requests.get_last('url')
81 81

  
82 82
    wscall.request = {'url': 'http://idp.example.net'}
83 83
    try:
84 84
        wscall.call()
85
    except:
85
    except Exception:
86 86
        pass
87 87
    assert 'orig=example.net' in http_requests.get_last('url')
88 88
    assert 'signature=' in http_requests.get_last('url')
......
91 91
    wscall.request = {'url': ' http://idp.example.net'}
92 92
    try:
93 93
        wscall.call()
94
    except:
94
    except Exception:
95 95
        pass
96 96
    assert 'orig=example.net' in http_requests.get_last('url')
97 97
    assert 'signature=' in http_requests.get_last('url')
......
99 99
    wscall.request['request_signature_key'] = 'blah'
100 100
    try:
101 101
        wscall.call()
102
    except:
102
    except Exception:
103 103
        pass
104 104
    assert not 'orig=example.net' in http_requests.get_last('url')
105 105
    assert 'signature=' in http_requests.get_last('url')
......
152 152
        }
153 153
        try:
154 154
            wscall.call()
155
        except:
155
        except Exception:
156 156
            pass
157 157
        assert http_requests.get_last('url') == wscall.request['url']
158 158
        assert http_requests.get_last('method') == wscall.request['method']
......
171 171
    }
172 172
    try:
173 173
        wscall.call()
174
    except:
174
    except Exception:
175 175
        pass
176 176
    assert http_requests.get_last('url') == wscall.request['url']
177 177
    assert http_requests.get_last('method') == 'DELETE'
178
-