From 07fd31f2e3c419541443cd879ee7583cace74773 Mon Sep 17 00:00:00 2001 From: Elias Dabbas Date: Mon, 30 Oct 2023 22:19:32 +0000 Subject: [PATCH] Change test tempdir to accomodate for windows testing --- tests/conftest.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 22527bdc..6d9b3e8d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,3 +1,4 @@ +from pathlib import Path from tempfile import TemporaryDirectory import pytest @@ -9,14 +10,14 @@ @pytest.fixture(scope="module") def crawl_dir(): with TemporaryDirectory() as temp_dir: - return temp_dir + return Path(temp_dir) @pytest.fixture(scope="module") def headers_crawl_df(crawl_dir): crawl_headers( ["https://adver.tools", "does not exist dot com"], - f"{crawl_dir}/headers_output.jl", + str(crawl_dir.joinpath("headers_output.jl")), custom_settings={ "ROBOTSTXT_OBEY": False, # "LOG_ENABLED": False, @@ -24,5 +25,5 @@ def headers_crawl_df(crawl_dir): }, ) - df = read_json(f"{crawl_dir}/headers_output.jl", lines=True) + df = read_json(crawl_dir.joinpath("headers_output.jl"), lines=True) return df