@@ -187,13 +187,52 @@ def test_transport_option(monkeypatch):
187
187
"arg_https_proxy" : None ,
188
188
"expected_proxy_scheme" : "http" ,
189
189
},
190
+ # NO_PROXY testcases
191
+ {
192
+ "dsn" : "http://foo@sentry.io/123" ,
193
+ "env_http_proxy" : "http://localhost/123" ,
194
+ "env_https_proxy" : None ,
195
+ "env_no_proxy" : "sentry.io,example.com" ,
196
+ "arg_http_proxy" : None ,
197
+ "arg_https_proxy" : None ,
198
+ "expected_proxy_scheme" : None ,
199
+ },
200
+ {
201
+ "dsn" : "https://foo@sentry.io/123" ,
202
+ "env_http_proxy" : None ,
203
+ "env_https_proxy" : "https://localhost/123" ,
204
+ "env_no_proxy" : "example.com,sentry.io" ,
205
+ "arg_http_proxy" : None ,
206
+ "arg_https_proxy" : None ,
207
+ "expected_proxy_scheme" : None ,
208
+ },
209
+ {
210
+ "dsn" : "http://foo@sentry.io/123" ,
211
+ "env_http_proxy" : None ,
212
+ "env_https_proxy" : None ,
213
+ "env_no_proxy" : "sentry.io,example.com" ,
214
+ "arg_http_proxy" : "http://localhost/123" ,
215
+ "arg_https_proxy" : None ,
216
+ "expected_proxy_scheme" : "http" ,
217
+ },
218
+ {
219
+ "dsn" : "https://foo@sentry.io/123" ,
220
+ "env_http_proxy" : None ,
221
+ "env_https_proxy" : None ,
222
+ "env_no_proxy" : "sentry.io,example.com" ,
223
+ "arg_http_proxy" : None ,
224
+ "arg_https_proxy" : "https://localhost/123" ,
225
+ "expected_proxy_scheme" : "https" ,
226
+ },
190
227
],
191
228
)
192
229
def test_proxy (monkeypatch , testcase ):
193
230
if testcase ["env_http_proxy" ] is not None :
194
231
monkeypatch .setenv ("HTTP_PROXY" , testcase ["env_http_proxy" ])
195
232
if testcase ["env_https_proxy" ] is not None :
196
233
monkeypatch .setenv ("HTTPS_PROXY" , testcase ["env_https_proxy" ])
234
+ if testcase .get ("env_no_proxy" ) is not None :
235
+ monkeypatch .setenv ("NO_PROXY" , testcase ["env_no_proxy" ])
197
236
kwargs = {}
198
237
if testcase ["arg_http_proxy" ] is not None :
199
238
kwargs ["http_proxy" ] = testcase ["arg_http_proxy" ]
0 commit comments