Skip to content

Commit e7eea23

Browse files
committed
remove Exception test
1 parent ca53a2c commit e7eea23

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

mini_spider_rebuild.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def download_file_to_local(url, filename, timeout=1):
5858
f = urllib2.urlopen(url, timeout=timeout)
5959
data = f.read()
6060
except Exception as e:
61+
logger.error('%s error', url)
6162
logger.error(e)
6263

6364
if data:

test_mini_spider.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import mini_spider_rebuild as mini
1515
import os
1616

17+
1718
class FuncTest(unittest.TestCase):
1819

1920
# 初始化工作
@@ -48,9 +49,6 @@ def tearDown(self):
4849
def test_download_file(self):
4950
mini.download_file_to_local(self.fm, self.to)
5051
self.assertTrue(os.path.exists(self.to))
51-
self.assertRaises(mini.download_file_to_local('wrong_path', 'no'))
52-
mini.download_file_to_local('wrong_path', 'no')
53-
5452

5553

5654
if __name__ == '__main__':

0 commit comments

Comments
 (0)