college-scraper / conftest.py
sharanyaswarup's picture
Initial commit: AISHE College Data Scraper v1.0
72acc1c
Raw
History Blame Contribute Delete
721 Bytes
"""
Pytest configuration for AISHE scraper tests.
Allows file downloads in browser context and adds a custom --output-dir option.
"""
import pytest
def pytest_addoption(parser):
parser.addoption(
"--output-dir",
action="store",
default="output/downloads",
help="Directory to save downloaded Excel files (default: output/downloads)",
)
@pytest.fixture
def output_dir(request):
"""Provide the output directory path to tests."""
return request.config.getoption("--output-dir")
@pytest.fixture
def browser_context_args(browser_context_args):
"""Enable file downloads in the Playwright browser context."""
return {**browser_context_args, "accept_downloads": True}