Spaces:
Running on Zero
Running on Zero
| """ | |
| 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)", | |
| ) | |
| def output_dir(request): | |
| """Provide the output directory path to tests.""" | |
| return request.config.getoption("--output-dir") | |
| def browser_context_args(browser_context_args): | |
| """Enable file downloads in the Playwright browser context.""" | |
| return {**browser_context_args, "accept_downloads": True} | |