Skip to content

TST: no need for flavor testing in skip #4257

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 1 commit into from
Jul 16, 2013
Merged
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
15 changes: 10 additions & 5 deletions pandas/io/tests/test_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,17 @@ def _skip_if_no(module_name):
def _skip_if_none_of(module_names):
if isinstance(module_names, basestring):
_skip_if_no(module_names)
if module_names == 'bs4':
import bs4
if bs4.__version__ == LooseVersion('4.2.0'):
raise nose.SkipTest
else:
if not all(_have_module(module_name) for module_name in module_names):
raise nose.SkipTest
if 'bs4' in module_names:
import bs4
if bs4.__version__ == LooseVersion('4.2.0'):
raise nose.SkipTest


DATA_PATH = get_data_path()
Expand Down Expand Up @@ -82,10 +90,6 @@ def run_read_html(self, *args, **kwargs):

def try_skip(self):
_skip_if_none_of(('bs4', 'html5lib'))
import bs4
if (bs4.__version__ == LooseVersion('4.2.0') and
self.flavor != ['lxml']):
raise nose.SkipTest

def setup_data(self):
self.spam_data = os.path.join(DATA_PATH, 'spam.html')
Expand Down Expand Up @@ -425,7 +429,8 @@ def try_skip(self):
def test_spam_data_fail(self):
from lxml.etree import XMLSyntaxError
spam_data = os.path.join(DATA_PATH, 'spam.html')
self.assertRaises(XMLSyntaxError, self.run_read_html, spam_data, flavor=['lxml'])
self.assertRaises(XMLSyntaxError, self.run_read_html, spam_data,
flavor=['lxml'])

def test_banklist_data_fail(self):
from lxml.etree import XMLSyntaxError
Expand Down