@@ -201,53 +201,6 @@ def test_invalid_url(self, url, set_env, env):
201201 assert 'Environment variable "URL" invalid' in excinfo .value .args [0 ]
202202
203203
204- class TestProxiedVariables :
205- def test_reading_proxied_variable (self , set_env , env ):
206- set_env (
207- {
208- "MAILGUN_SMTP_LOGIN" : "sloria" ,
209- "SMTP_LOGIN" : "{{MAILGUN_SMTP_LOGIN}}" ,
210- "SMTP_LOGIN_LPADDED" : "{{ MAILGUN_SMTP_LOGIN}}" ,
211- "SMTP_LOGIN_RPADDED" : "{{MAILGUN_SMTP_LOGIN }}" ,
212- }
213- )
214- assert env ("MAILGUN_SMTP_LOGIN" ) == "sloria"
215- assert env .dump ()["MAILGUN_SMTP_LOGIN" ] == "sloria"
216- for key in ("SMTP_LOGIN" , "SMTP_LOGIN_LPADDED" , "SMTP_LOGIN_RPADDED" ):
217- with pytest .warns (DeprecationWarning , match = "Proxied variables are deprecated" ):
218- assert env (key ) == "sloria"
219- assert env .dump ()[key ] == "sloria"
220-
221- def test_reading_missing_proxied_variable (self , set_env , env ):
222- set_env ({"SMTP_LOGIN" : "{{MAILGUN_SMTP_LOGIN}}" })
223- with pytest .raises (environs .EnvError ) as excinfo :
224- with pytest .warns (DeprecationWarning , match = "Proxied variables are deprecated" ):
225- env ("SMTP_LOGIN" )
226- assert excinfo .value .args [0 ] == 'Environment variable "MAILGUN_SMTP_LOGIN" not set'
227- with pytest .warns (DeprecationWarning , match = "Proxied variables are deprecated" ):
228- assert env ("SMTP_LOGIN" , "default" ) == "default"
229-
230- def test_reading_proxied_variable_in_prefix_scope (self , set_env , env ):
231- set_env (
232- {
233- "MAILGUN_SMTP_LOGIN" : "szabolcs" ,
234- "SMTP_LOGIN" : "{{MAILGUN_SMTP_LOGIN}}" ,
235- "SMTP_PASSWORD" : "secret" ,
236- "SMTP_NESTED_LOGIN" : "{{SMTP_LOGIN}}" ,
237- "SMTP_NESTED_PASSWORD" : "nested-secret" ,
238- }
239- )
240-
241- with env .prefixed ("SMTP_" ):
242- with pytest .warns (DeprecationWarning , match = "Proxied variables are deprecated" ):
243- assert env .str ("LOGIN" ) == "szabolcs"
244- assert env .str ("PASSWORD" ) == "secret"
245- with env .prefixed ("NESTED_" ):
246- with pytest .warns (DeprecationWarning , match = "Proxied variables are deprecated" ):
247- assert env .str ("LOGIN" ) == "szabolcs"
248- assert env .str ("PASSWORD" ) == "nested-secret"
249-
250-
251204class TestEnvFileReading :
252205 def test_read_env (self , env ):
253206 if "STRING" in os .environ :
@@ -256,8 +209,6 @@ def test_read_env(self, env):
256209 env .read_env ()
257210 assert env ("STRING" ) == "foo"
258211 assert env .list ("LIST" ) == ["wat" , "wer" , "wen" ]
259- with pytest .warns (DeprecationWarning , match = "Proxied variables are deprecated" ):
260- assert env ("PROXIED" ) == "foo"
261212 assert env ("EXPANDED" ) == "foo"
262213
263214 # Regression test for https://github.com/sloria/environs/issues/96
0 commit comments