From a5562e540182229ebf6b19f6e4be67a5083c5c1a Mon Sep 17 00:00:00 2001 From: Richard Shadrach Date: Sat, 20 Dec 2025 12:36:20 -0500 Subject: [PATCH] TST: Use datapath in tests --- pandas/tests/io/formats/style/test_html.py | 5 +++-- pandas/tests/io/test_common.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pandas/tests/io/formats/style/test_html.py b/pandas/tests/io/formats/style/test_html.py index e46a59197a3b7..0b225126b0a70 100644 --- a/pandas/tests/io/formats/style/test_html.py +++ b/pandas/tests/io/formats/style/test_html.py @@ -57,10 +57,11 @@ def tpl_table(env): return env.get_template("html_table.tpl") -def test_html_template_extends_options(): +def test_html_template_extends_options(datapath): # make sure if templates are edited tests are updated as are setup fixtures # to understand the dependency - with open("pandas/io/formats/templates/html.tpl", encoding="utf-8") as file: + path = datapath("..", "io", "formats", "templates", "html.tpl") + with open(path, encoding="utf-8") as file: result = file.read() assert "{% include html_style_tpl %}" in result assert "{% include html_table_tpl %}" in result diff --git a/pandas/tests/io/test_common.py b/pandas/tests/io/test_common.py index 5ff7ad5a4e785..7c6e730532e55 100644 --- a/pandas/tests/io/test_common.py +++ b/pandas/tests/io/test_common.py @@ -641,9 +641,9 @@ def close(self): @td.skip_if_no("fsspec") @pytest.mark.parametrize("compression", [None, "infer"]) -def test_read_csv_chained_url_no_error(compression): +def test_read_csv_chained_url_no_error(datapath, compression): # GH 60100 - tar_file_path = "pandas/tests/io/data/tar/test-csv.tar" + tar_file_path = datapath("io", "data", "tar", "test-csv.tar") chained_file_url = f"tar://test.csv::file://{tar_file_path}" result = pd.read_csv(chained_file_url, compression=compression, sep=";")