@@ -92,66 +92,66 @@ def test_proxy_none_noenv(monkeypatch):
92
92
93
93
94
94
def test_proxy_none_httpenv_select (monkeypatch ):
95
- os . environ [ "HTTP_PROXY" ] = "http://localhost/123"
95
+ monkeypatch . setenv ( "HTTP_PROXY" , "http://localhost/123" )
96
96
client = Client ("http://foo@sentry.io/123" )
97
97
assert client .transport ._pool .proxy .scheme == "http"
98
98
99
99
100
100
def test_proxy_none_httpsenv_select (monkeypatch ):
101
- os . environ [ "HTTPS_PROXY" ] = "https://localhost/123"
101
+ monkeypatch . setenv ( "HTTPS_PROXY" , "https://localhost/123" )
102
102
client = Client ("https://foo@sentry.io/123" )
103
103
assert client .transport ._pool .proxy .scheme == "https"
104
104
105
105
106
106
def test_proxy_none_httpenv_fallback (monkeypatch ):
107
- os . environ [ "HTTP_PROXY" ] = "http://localhost/123"
107
+ monkeypatch . setenv ( "HTTP_PROXY" , "http://localhost/123" )
108
108
client = Client ("https://foo@sentry.io/123" )
109
109
assert client .transport ._pool .proxy .scheme == "http"
110
110
111
111
112
112
def test_proxy_bothselect_bothen (monkeypatch ):
113
- os . environ [ "HTTP_PROXY" ] = "http://localhost/123"
114
- os . environ [ "HTTPS_PROXY" ] = "https://localhost/123"
113
+ monkeypatch . setenv ( "HTTP_PROXY" , "http://localhost/123" )
114
+ monkeypatch . setenv ( "HTTPS_PROXY" , "https://localhost/123" )
115
115
client = Client ("https://foo@sentry.io/123" , http_proxy = "" , https_proxy = "" )
116
116
assert client .transport ._pool .proxy is None
117
117
118
118
119
119
def test_proxy_bothavoid_bothenv (monkeypatch ):
120
- os . environ [ "HTTP_PROXY" ] = "http://localhost/123"
121
- os . environ [ "HTTPS_PROXY" ] = "https://localhost/123"
120
+ monkeypatch . setenv ( "HTTP_PROXY" , "http://localhost/123" )
121
+ monkeypatch . setenv ( "HTTPS_PROXY" , "https://localhost/123" )
122
122
client = Client ("https://foo@sentry.io/123" , http_proxy = None , https_proxy = None )
123
123
assert client .transport ._pool .proxy .scheme == "https"
124
124
125
125
126
126
def test_proxy_bothselect_httpenv (monkeypatch ):
127
- os . environ [ "HTTP_PROXY" ] = "http://localhost/123"
127
+ monkeypatch . setenv ( "HTTP_PROXY" , "http://localhost/123" )
128
128
client = Client ("https://foo@sentry.io/123" , http_proxy = None , https_proxy = None )
129
129
assert client .transport ._pool .proxy .scheme == "http"
130
130
131
131
132
132
def test_proxy_httpselect_bothenv (monkeypatch ):
133
- os . environ [ "HTTP_PROXY" ] = "http://localhost/123"
134
- os . environ [ "HTTPS_PROXY" ] = "https://localhost/123"
133
+ monkeypatch . setenv ( "HTTP_PROXY" , "http://localhost/123" )
134
+ monkeypatch . setenv ( "HTTPS_PROXY" , "https://localhost/123" )
135
135
client = Client ("https://foo@sentry.io/123" , http_proxy = None , https_proxy = "" )
136
136
assert client .transport ._pool .proxy .scheme == "http"
137
137
138
138
139
139
def test_proxy_httpsselect_bothenv (monkeypatch ):
140
- os . environ [ "HTTP_PROXY" ] = "http://localhost/123"
141
- os . environ [ "HTTPS_PROXY" ] = "https://localhost/123"
140
+ monkeypatch . setenv ( "HTTP_PROXY" , "http://localhost/123" )
141
+ monkeypatch . setenv ( "HTTPS_PROXY" , "https://localhost/123" )
142
142
client = Client ("https://foo@sentry.io/123" , http_proxy = "" , https_proxy = None )
143
143
assert client .transport ._pool .proxy .scheme == "https"
144
144
145
145
146
146
def test_proxy_httpselect_httpsenv (monkeypatch ):
147
- os . environ [ "HTTPS_PROXY" ] = "https://localhost/123"
147
+ monkeypatch . setenv ( "HTTPS_PROXY" , "https://localhost/123" )
148
148
client = Client ("https://foo@sentry.io/123" , http_proxy = None , https_proxy = "" )
149
149
assert client .transport ._pool .proxy is None
150
150
151
151
152
152
def test_proxy_httpsselect_bothenv_http (monkeypatch ):
153
- os . environ [ "HTTP_PROXY" ] = "http://localhost/123"
154
- os . environ [ "HTTPS_PROXY" ] = "https://localhost/123"
153
+ monkeypatch . setenv ( "HTTP_PROXY" , "http://localhost/123" )
154
+ monkeypatch . setenv ( "HTTPS_PROXY" , "https://localhost/123" )
155
155
client = Client ("http://foo@sentry.io/123" , http_proxy = None , https_proxy = None )
156
156
assert client .transport ._pool .proxy .scheme == "http"
157
157
0 commit comments