1- import netrc , os , unittest , sys , tempfile , textwrap
1+ import netrc , os , unittest , sys , textwrap
22from contextlib import ExitStack
33from test .support import os_helper , subTests
44from unittest import mock
@@ -24,7 +24,7 @@ def __enter__(self):
2424 self .environ = self .stack .enter_context (
2525 os_helper .EnvironmentVarGuard (),
2626 )
27- self .tmpdir = self .stack .enter_context (tempfile . TemporaryDirectory ())
27+ self .tmpdir = self .stack .enter_context (os_helper . temp_dir ())
2828 return self
2929
3030 def __exit__ (self , * ignore_exc ):
@@ -110,8 +110,7 @@ def test_toplevel_non_ordered_tokens(self, make_nrc):
110110 machine host.domain.com password pass1 login log1 account acct1
111111 default login log2 password pass2 account acct2
112112 """ )
113- self .assertEqual (nrc .hosts ['host.domain.com' ],
114- ('log1' , 'acct1' , 'pass1' ))
113+ self .assertEqual (nrc .hosts ['host.domain.com' ], ('log1' , 'acct1' , 'pass1' ))
115114 self .assertEqual (nrc .hosts ['default' ], ('log2' , 'acct2' , 'pass2' ))
116115
117116 @subTests ('make_nrc' , ALL_NETRC_FILE_SCENARIOS )
@@ -120,8 +119,7 @@ def test_toplevel_tokens(self, make_nrc):
120119 machine host.domain.com login log1 password pass1 account acct1
121120 default login log2 password pass2 account acct2
122121 """ )
123- self .assertEqual (nrc .hosts ['host.domain.com' ],
124- ('log1' , 'acct1' , 'pass1' ))
122+ self .assertEqual (nrc .hosts ['host.domain.com' ], ('log1' , 'acct1' , 'pass1' ))
125123 self .assertEqual (nrc .hosts ['default' ], ('log2' , 'acct2' , 'pass2' ))
126124
127125 @subTests ('make_nrc' , ALL_NETRC_FILE_SCENARIOS )
0 commit comments