16
16
17
17
import numpy as np
18
18
from numpy .random import rand
19
- from numpy .testing .decorators import slow
20
19
21
20
from pandas import (DataFrame , MultiIndex , read_csv , Timestamp , Index ,
22
21
date_range , Series )
@@ -129,7 +128,7 @@ def test_spam_url(self):
129
128
130
129
assert_framelist_equal (df1 , df2 )
131
130
132
- @slow
131
+ @tm . slow
133
132
def test_banklist (self ):
134
133
df1 = self .read_html (self .banklist_data , '.*Florida.*' ,
135
134
attrs = {'id' : 'table' })
@@ -289,9 +288,9 @@ def test_invalid_url(self):
289
288
self .read_html ('http://www.a23950sdfa908sd.com' ,
290
289
match = '.*Water.*' )
291
290
except ValueError as e :
292
- tm . assert_equal (str (e ), 'No tables found' )
291
+ self . assertEqual (str (e ), 'No tables found' )
293
292
294
- @slow
293
+ @tm . slow
295
294
def test_file_url (self ):
296
295
url = self .banklist_data
297
296
dfs = self .read_html (file_path_to_url (url ), 'First' ,
@@ -300,7 +299,7 @@ def test_file_url(self):
300
299
for df in dfs :
301
300
tm .assertIsInstance (df , DataFrame )
302
301
303
- @slow
302
+ @tm . slow
304
303
def test_invalid_table_attrs (self ):
305
304
url = self .banklist_data
306
305
with tm .assertRaisesRegexp (ValueError , 'No tables found' ):
@@ -311,39 +310,39 @@ def _bank_data(self, *args, **kwargs):
311
310
return self .read_html (self .banklist_data , 'Metcalf' ,
312
311
attrs = {'id' : 'table' }, * args , ** kwargs )
313
312
314
- @slow
313
+ @tm . slow
315
314
def test_multiindex_header (self ):
316
315
df = self ._bank_data (header = [0 , 1 ])[0 ]
317
316
tm .assertIsInstance (df .columns , MultiIndex )
318
317
319
- @slow
318
+ @tm . slow
320
319
def test_multiindex_index (self ):
321
320
df = self ._bank_data (index_col = [0 , 1 ])[0 ]
322
321
tm .assertIsInstance (df .index , MultiIndex )
323
322
324
- @slow
323
+ @tm . slow
325
324
def test_multiindex_header_index (self ):
326
325
df = self ._bank_data (header = [0 , 1 ], index_col = [0 , 1 ])[0 ]
327
326
tm .assertIsInstance (df .columns , MultiIndex )
328
327
tm .assertIsInstance (df .index , MultiIndex )
329
328
330
- @slow
329
+ @tm . slow
331
330
def test_multiindex_header_skiprows_tuples (self ):
332
331
df = self ._bank_data (header = [0 , 1 ], skiprows = 1 , tupleize_cols = True )[0 ]
333
332
tm .assertIsInstance (df .columns , Index )
334
333
335
- @slow
334
+ @tm . slow
336
335
def test_multiindex_header_skiprows (self ):
337
336
df = self ._bank_data (header = [0 , 1 ], skiprows = 1 )[0 ]
338
337
tm .assertIsInstance (df .columns , MultiIndex )
339
338
340
- @slow
339
+ @tm . slow
341
340
def test_multiindex_header_index_skiprows (self ):
342
341
df = self ._bank_data (header = [0 , 1 ], index_col = [0 , 1 ], skiprows = 1 )[0 ]
343
342
tm .assertIsInstance (df .index , MultiIndex )
344
343
tm .assertIsInstance (df .columns , MultiIndex )
345
344
346
- @slow
345
+ @tm . slow
347
346
def test_regex_idempotency (self ):
348
347
url = self .banklist_data
349
348
dfs = self .read_html (file_path_to_url (url ),
@@ -371,7 +370,7 @@ def test_python_docs_table(self):
371
370
zz = [df .iloc [0 , 0 ][0 :4 ] for df in dfs ]
372
371
self .assertEqual (sorted (zz ), sorted (['Repo' , 'What' ]))
373
372
374
- @slow
373
+ @tm . slow
375
374
def test_thousands_macau_stats (self ):
376
375
all_non_nan_table_index = - 2
377
376
macau_data = os .path .join (DATA_PATH , 'macau.html' )
@@ -381,7 +380,7 @@ def test_thousands_macau_stats(self):
381
380
382
381
self .assertFalse (any (s .isnull ().any () for _ , s in df .iteritems ()))
383
382
384
- @slow
383
+ @tm . slow
385
384
def test_thousands_macau_index_col (self ):
386
385
all_non_nan_table_index = - 2
387
386
macau_data = os .path .join (DATA_PATH , 'macau.html' )
@@ -522,7 +521,7 @@ def test_nyse_wsj_commas_table(self):
522
521
self .assertEqual (df .shape [0 ], nrows )
523
522
self .assertTrue (df .columns .equals (columns ))
524
523
525
- @slow
524
+ @tm . slow
526
525
def test_banklist_header (self ):
527
526
from pandas .io .html import _remove_whitespace
528
527
@@ -561,7 +560,7 @@ def try_remove_ws(x):
561
560
coerce = True )
562
561
tm .assert_frame_equal (converted , gtnew )
563
562
564
- @slow
563
+ @tm . slow
565
564
def test_gold_canyon (self ):
566
565
gc = 'Gold Canyon'
567
566
with open (self .banklist_data , 'r' ) as f :
@@ -663,7 +662,7 @@ def test_wikipedia_states_table(self):
663
662
assert os .path .isfile (data ), '%r is not a file' % data
664
663
assert os .path .getsize (data ), '%r is an empty file' % data
665
664
result = self .read_html (data , 'Arizona' , header = 1 )[0 ]
666
- nose . tools . assert_equal (result ['sq mi' ].dtype , np .dtype ('float64' ))
665
+ self . assertEqual (result ['sq mi' ].dtype , np .dtype ('float64' ))
667
666
668
667
def test_bool_header_arg (self ):
669
668
# GH 6114
@@ -753,7 +752,7 @@ def test_works_on_valid_markup(self):
753
752
tm .assertIsInstance (dfs , list )
754
753
tm .assertIsInstance (dfs [0 ], DataFrame )
755
754
756
- @slow
755
+ @tm . slow
757
756
def test_fallback_success (self ):
758
757
_skip_if_none_of (('bs4' , 'html5lib' ))
759
758
banklist_data = os .path .join (DATA_PATH , 'banklist.html' )
@@ -796,7 +795,7 @@ def get_elements_from_file(url, element='table'):
796
795
return soup .find_all (element )
797
796
798
797
799
- @slow
798
+ @tm . slow
800
799
def test_bs4_finds_tables ():
801
800
filepath = os .path .join (DATA_PATH , "spam.html" )
802
801
with warnings .catch_warnings ():
@@ -811,13 +810,13 @@ def get_lxml_elements(url, element):
811
810
return doc .xpath ('.//{0}' .format (element ))
812
811
813
812
814
- @slow
813
+ @tm . slow
815
814
def test_lxml_finds_tables ():
816
815
filepath = os .path .join (DATA_PATH , "spam.html" )
817
816
assert get_lxml_elements (filepath , 'table' )
818
817
819
818
820
- @slow
819
+ @tm . slow
821
820
def test_lxml_finds_tbody ():
822
821
filepath = os .path .join (DATA_PATH , "spam.html" )
823
822
assert get_lxml_elements (filepath , 'tbody' )
0 commit comments