Skip to content

Commit c6b7ea1

Browse files
committed
Move unnecessary fixture into test body
1 parent ba7caab commit c6b7ea1

File tree

1 file changed

+26
-28
lines changed

1 file changed

+26
-28
lines changed

pandas/tests/io/test_html.py

+26-28
Original file line numberDiff line numberDiff line change
@@ -136,33 +136,6 @@ def gh_13141_data(self):
136136
</table>
137137
"""
138138

139-
@pytest.fixture
140-
def gh_13141_expected(self):
141-
return {
142-
"head_ignore": ["HTTP", "FTP", "Linkless"],
143-
"head_extract": [
144-
("HTTP", None),
145-
("FTP", None),
146-
("Linkless", "https://en.wiktionary.org/wiki/linkless"),
147-
],
148-
"body_ignore": ["Wikipedia", "SURROUNDING Debian TEXT", "Linkless"],
149-
"body_extract": [
150-
("Wikipedia", "https://en.wikipedia.org/"),
151-
("SURROUNDING Debian TEXT", "ftp://ftp.us.debian.org/"),
152-
("Linkless", None),
153-
],
154-
"footer_ignore": [
155-
"Footer",
156-
"Multiple links: Only first captured.",
157-
None,
158-
],
159-
"footer_extract": [
160-
("Footer", "https://en.wikipedia.org/wiki/Page_footer"),
161-
("Multiple links: Only first captured.", "1"),
162-
None,
163-
],
164-
}
165-
166139
@pytest.fixture(autouse=True, scope="function")
167140
def set_defaults(self, flavor):
168141
self.read_html = partial(read_html, flavor=flavor)
@@ -1394,7 +1367,32 @@ def test_parse_br_as_space(self):
13941367
tm.assert_frame_equal(result, expected)
13951368

13961369
@pytest.mark.parametrize("arg", ["all", "body", "header", "footer"])
1397-
def test_extract_links(self, gh_13141_data, gh_13141_expected, arg):
1370+
def test_extract_links(self, gh_13141_data, arg):
1371+
gh_13141_expected = {
1372+
"head_ignore": ["HTTP", "FTP", "Linkless"],
1373+
"head_extract": [
1374+
("HTTP", None),
1375+
("FTP", None),
1376+
("Linkless", "https://en.wiktionary.org/wiki/linkless"),
1377+
],
1378+
"body_ignore": ["Wikipedia", "SURROUNDING Debian TEXT", "Linkless"],
1379+
"body_extract": [
1380+
("Wikipedia", "https://en.wikipedia.org/"),
1381+
("SURROUNDING Debian TEXT", "ftp://ftp.us.debian.org/"),
1382+
("Linkless", None),
1383+
],
1384+
"footer_ignore": [
1385+
"Footer",
1386+
"Multiple links: Only first captured.",
1387+
None,
1388+
],
1389+
"footer_extract": [
1390+
("Footer", "https://en.wikipedia.org/wiki/Page_footer"),
1391+
("Multiple links: Only first captured.", "1"),
1392+
None,
1393+
],
1394+
}
1395+
13981396
data_exp = gh_13141_expected["body_ignore"]
13991397
foot_exp = gh_13141_expected["footer_ignore"]
14001398
head_exp = gh_13141_expected["head_ignore"]

0 commit comments

Comments
 (0)