File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
- import tempfile
2
1
import unittest
3
2
from test import test_support
4
3
from test .test_urllib2net import skip_ftp_test_on_travis
@@ -224,9 +223,10 @@ def test_multiple_ftp_retrieves(self):
224
223
225
224
with test_support .transient_internet (self .FTP_TEST_FILE ):
226
225
try :
227
- for _ in range (self .NUM_FTP_RETRIEVES ):
228
- with tempfile .NamedTemporaryFile () as fp :
229
- urllib .FancyURLopener ().retrieve (self .FTP_TEST_FILE , fp .name )
226
+ for file_num in range (self .NUM_FTP_RETRIEVES ):
227
+ with test_support .temp_dir () as td :
228
+ urllib .FancyURLopener ().retrieve (self .FTP_TEST_FILE ,
229
+ os .path .join (td , str (file_num )))
230
230
except IOError as e :
231
231
self .fail ("Failed FTP retrieve while accessing ftp url "
232
232
"multiple times.\n Error message was : %s" % e )
You can’t perform that action at this time.
0 commit comments