From 4bf4c4f6a329fdb7ad2d6718d2fb6b810ceb9e2f Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Thu, 4 Mar 2021 14:43:03 -0600 Subject: [PATCH 1/3] DEPS: skip html tests if html5lib is not installed #40198 --- pandas/tests/io/test_html.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pandas/tests/io/test_html.py b/pandas/tests/io/test_html.py index 9f1df201ee0e6..6c5b700656149 100644 --- a/pandas/tests/io/test_html.py +++ b/pandas/tests/io/test_html.py @@ -69,6 +69,7 @@ def assert_framelist_equal(list1, list2, *args, **kwargs): @td.skip_if_no("bs4") +@td.skip_if_no("html5lib") def test_bs4_version_fails(monkeypatch, datapath): import bs4 @@ -88,6 +89,7 @@ def test_invalid_flavor(): @td.skip_if_no("bs4") @td.skip_if_no("lxml") +@td.skip_if_no("html5lib") def test_same_ordering(datapath): filename = datapath("io", "data", "html", "valid_markup.html") dfs_lxml = read_html(filename, index_col=0, flavor=["lxml"]) @@ -100,6 +102,7 @@ def test_same_ordering(datapath): [ pytest.param("bs4", marks=td.skip_if_no("bs4")), pytest.param("lxml", marks=td.skip_if_no("lxml")), + pytest.param("html5lib", marks=td.skip_if_no("lxml")), ], scope="class", ) From 7a6665af7a2e1f4ae7c8ca7b77a83e9446137edf Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Thu, 4 Mar 2021 16:32:32 -0600 Subject: [PATCH 2/3] fix typo --- pandas/tests/io/test_html.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/io/test_html.py b/pandas/tests/io/test_html.py index 6c5b700656149..ca71f75067192 100644 --- a/pandas/tests/io/test_html.py +++ b/pandas/tests/io/test_html.py @@ -102,7 +102,7 @@ def test_same_ordering(datapath): [ pytest.param("bs4", marks=td.skip_if_no("bs4")), pytest.param("lxml", marks=td.skip_if_no("lxml")), - pytest.param("html5lib", marks=td.skip_if_no("lxml")), + pytest.param("html5lib", marks=td.skip_if_no("html5lib")), ], scope="class", ) From 4681fcb1817dae71bb7d218a84a6002dc678d1ec Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Thu, 4 Mar 2021 18:54:36 -0600 Subject: [PATCH 3/3] fix marker --- pandas/tests/io/test_html.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pandas/tests/io/test_html.py b/pandas/tests/io/test_html.py index ca71f75067192..f842e4cd58863 100644 --- a/pandas/tests/io/test_html.py +++ b/pandas/tests/io/test_html.py @@ -100,9 +100,8 @@ def test_same_ordering(datapath): @pytest.mark.parametrize( "flavor", [ - pytest.param("bs4", marks=td.skip_if_no("bs4")), + pytest.param("bs4", marks=[td.skip_if_no("bs4"), td.skip_if_no("html5lib")]), pytest.param("lxml", marks=td.skip_if_no("lxml")), - pytest.param("html5lib", marks=td.skip_if_no("html5lib")), ], scope="class", )