diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2007-03-20 06:13:25 +0000 |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2007-03-20 06:13:25 +0000 |
commit | ce2ab351f077f2b0ce562fd91576dc23eca8b59c (patch) | |
tree | 08009b70d7be506fd946721ec0230395ccf48c47 /Lib/test | |
parent | c990f6454f2725c143f215d49de305ecb2a935e0 (diff) | |
download | cpython-git-ce2ab351f077f2b0ce562fd91576dc23eca8b59c.tar.gz |
Try to make this test more resistant to dropping from previous runs (ie, files that may exist but cause the test to fail). Should be backported (assuming it works :-)
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_urllib.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py index 294ed5e06a..4851742aff 100644 --- a/Lib/test/test_urllib.py +++ b/Lib/test/test_urllib.py @@ -27,6 +27,7 @@ class urlopen_FileTests(unittest.TestCase): def setUp(self): """Setup of a temp file to use for testing""" self.text = "test_urllib: %s\n" % self.__class__.__name__ + test_support.unlink(test_support.TESTFN) FILE = file(test_support.TESTFN, 'wb') try: FILE.write(self.text) @@ -195,6 +196,7 @@ class urlretrieve_FileTests(unittest.TestCase): def test_copy(self): # Test that setting the filename argument works. second_temp = "%s.2" % test_support.TESTFN + test_support.unlink(second_temp) self.registerFileForCleanUp(second_temp) result = urllib.urlretrieve(self.constructLocalFileUrl( test_support.TESTFN), second_temp) @@ -219,6 +221,7 @@ class urlretrieve_FileTests(unittest.TestCase): self.assertEqual(count, count_holder[0]) count_holder[0] = count_holder[0] + 1 second_temp = "%s.2" % test_support.TESTFN + test_support.unlink(second_temp) self.registerFileForCleanUp(second_temp) urllib.urlretrieve(self.constructLocalFileUrl(test_support.TESTFN), second_temp, hooktester) |