@@ -91,7 +91,6 @@ def test_to_html_compat(self):
91
91
assert_frame_equal (res , df )
92
92
93
93
@network
94
- @slow
95
94
def test_banklist_url (self ):
96
95
url = 'http://www.fdic.gov/bank/individual/failed/banklist.html'
97
96
df1 = self .run_read_html (url , 'First Federal Bank of Florida' ,
@@ -101,7 +100,6 @@ def test_banklist_url(self):
101
100
assert_framelist_equal (df1 , df2 )
102
101
103
102
@network
104
- @slow
105
103
def test_spam_url (self ):
106
104
url = ('http://ndb.nal.usda.gov/ndb/foods/show/1732?fg=&man=&'
107
105
'lfacet=&format=&count=&max=25&offset=&sort=&qlookup=spam' )
@@ -332,15 +330,14 @@ def test_negative_skiprows_banklist(self):
332
330
self .assertRaises (AssertionError , self .run_read_html , url , 'Florida' ,
333
331
skiprows = - 1 )
334
332
335
- @slow
333
+ @network
336
334
def test_multiple_matches (self ):
337
335
url = 'http://code.google.com/p/pythonxy/wiki/StandardPlugins'
338
336
dfs = self .run_read_html (url , match = 'Python' ,
339
337
attrs = {'class' : 'wikitable' })
340
338
self .assertGreater (len (dfs ), 1 )
341
339
342
340
@network
343
- @slow
344
341
def test_pythonxy_plugins_table (self ):
345
342
url = 'http://code.google.com/p/pythonxy/wiki/StandardPlugins'
346
343
dfs = self .run_read_html (url , match = 'Python' ,
@@ -438,8 +435,9 @@ def test_invalid_flavor():
438
435
flavor = 'not a* valid**++ flaver' )
439
436
440
437
441
- def get_elements_from_url (url , element = 'table' ):
438
+ def get_elements_from_url (url , element = 'table' , base_url = "file://" ):
442
439
_skip_if_none_of (('bs4' , 'html5lib' ))
440
+ url = "" .join ([base_url , url ])
443
441
from bs4 import BeautifulSoup , SoupStrainer
444
442
strainer = SoupStrainer (element )
445
443
with closing (urlopen (url )) as f :
@@ -449,11 +447,10 @@ def get_elements_from_url(url, element='table'):
449
447
450
448
@slow
451
449
def test_bs4_finds_tables ():
452
- url = ('http://ndb.nal.usda.gov/ndb/foods/show/1732?fg=&man=&'
453
- 'lfacet=&format=&count=&max=25&offset=&sort=&qlookup=spam' )
450
+ filepath = os .path .join (DATA_PATH , "spam.html" )
454
451
with warnings .catch_warnings ():
455
452
warnings .filterwarnings ('ignore' )
456
- assert get_elements_from_url (url , 'table' )
453
+ assert get_elements_from_url (filepath , 'table' )
457
454
458
455
459
456
def get_lxml_elements (url , element ):
@@ -465,13 +462,11 @@ def get_lxml_elements(url, element):
465
462
466
463
@slow
467
464
def test_lxml_finds_tables ():
468
- url = ('http://ndb.nal.usda.gov/ndb/foods/show/1732?fg=&man=&'
469
- 'lfacet=&format=&count=&max=25&offset=&sort=&qlookup=spam' )
470
- assert get_lxml_elements (url , 'table' )
465
+ filepath = os .path .join (DATA_PATH , "spam.html" )
466
+ assert get_lxml_elements (filepath , 'table' )
471
467
472
468
473
469
@slow
474
470
def test_lxml_finds_tbody ():
475
- url = ('http://ndb.nal.usda.gov/ndb/foods/show/1732?fg=&man=&'
476
- 'lfacet=&format=&count=&max=25&offset=&sort=&qlookup=spam' )
477
- assert get_lxml_elements (url , 'tbody' )
471
+ filepath = os .path .join (DATA_PATH , "spam.html" )
472
+ assert get_lxml_elements (filepath , 'tbody' )
0 commit comments