Skip to content

TST/BLD: add proper skips for bad bs4 version #4259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 16, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ci/requirements-2.6.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ numpy==1.6.1
cython==0.19.1
python-dateutil==2.1
pytz==2013b
http://www.crummy.com/software/BeautifulSoup/bs4/download/4.2/beautifulsoup4-4.2.0.tar.gz
html5lib==1.0b2
12 changes: 7 additions & 5 deletions pandas/io/tests/test_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def _have_module(module_name):

def _skip_if_no(module_name):
if not _have_module(module_name):
raise nose.SkipTest
raise nose.SkipTest("{0} not found".format(module_name))


def _skip_if_none_of(module_names):
Expand All @@ -46,14 +46,16 @@ def _skip_if_none_of(module_names):
if module_names == 'bs4':
import bs4
if bs4.__version__ == LooseVersion('4.2.0'):
raise nose.SkipTest
raise nose.SkipTest("Bad version of bs4: 4.2.0")
else:
if not all(_have_module(module_name) for module_name in module_names):
raise nose.SkipTest
not_found = [module_name for module_name in module_names if not
_have_module(module_name)]
if not_found == module_names:
raise nose.SkipTest("{0} not found".format(not_found))
if 'bs4' in module_names:
import bs4
if bs4.__version__ == LooseVersion('4.2.0'):
raise nose.SkipTest
raise nose.SkipTest("Bad version of bs4: 4.2.0")


DATA_PATH = get_data_path()
Expand Down