Skip to content

Commit 93eb9a4

Browse files
authored
TST: Use datapath in tests (#63440)
1 parent 92cb39b commit 93eb9a4

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

pandas/tests/io/formats/style/test_html.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,11 @@ def tpl_table(env):
5757
return env.get_template("html_table.tpl")
5858

5959

60-
def test_html_template_extends_options():
60+
def test_html_template_extends_options(datapath):
6161
# make sure if templates are edited tests are updated as are setup fixtures
6262
# to understand the dependency
63-
with open("pandas/io/formats/templates/html.tpl", encoding="utf-8") as file:
63+
path = datapath("..", "io", "formats", "templates", "html.tpl")
64+
with open(path, encoding="utf-8") as file:
6465
result = file.read()
6566
assert "{% include html_style_tpl %}" in result
6667
assert "{% include html_table_tpl %}" in result

pandas/tests/io/test_common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,9 +641,9 @@ def close(self):
641641

642642
@td.skip_if_no("fsspec")
643643
@pytest.mark.parametrize("compression", [None, "infer"])
644-
def test_read_csv_chained_url_no_error(compression):
644+
def test_read_csv_chained_url_no_error(datapath, compression):
645645
# GH 60100
646-
tar_file_path = "pandas/tests/io/data/tar/test-csv.tar"
646+
tar_file_path = datapath("io", "data", "tar", "test-csv.tar")
647647
chained_file_url = f"tar://test.csv::file://{tar_file_path}"
648648

649649
result = pd.read_csv(chained_file_url, compression=compression, sep=";")

0 commit comments

Comments
 (0)