Skip to content

Commit

Permalink
Change test tempdir to accomodate for windows testing
Browse files Browse the repository at this point in the history
  • Loading branch information
eliasdabbas committed Oct 30, 2023
1 parent 34b4599 commit 07fd31f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from pathlib import Path
from tempfile import TemporaryDirectory

import pytest
Expand All @@ -9,20 +10,20 @@
@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,
"DEFAULT_REQUEST_HEADERS": {"Accept-Language": "en"},
},
)

df = read_json(f"{crawl_dir}/headers_output.jl", lines=True)
df = read_json(crawl_dir.joinpath("headers_output.jl"), lines=True)
return df

0 comments on commit 07fd31f

Please sign in to comment.