diff --git a/scrapers/__init__.py b/scrapers/__init__.py index 391f349..8de8c42 100644 --- a/scrapers/__init__.py +++ b/scrapers/__init__.py @@ -42,6 +42,16 @@ _REGISTRY_FUNCTIONS = [ __all__ = _BASE_EXPORTS + _SCRAPER_CLASSES + _REGISTRY_FUNCTIONS +_exported_types = ( + ScraperConfig, + ContestListResult, + ContestSummary, + MetadataResult, + ProblemSummary, + TestCase, + TestsResult, +) + def get_scraper(platform: str) -> type[BaseScraper]: if platform not in ALL_SCRAPERS: diff --git a/tests/scrapers/test_codeforces.py b/tests/scrapers/test_codeforces.py index 8c436a3..a7ff800 100644 --- a/tests/scrapers/test_codeforces.py +++ b/tests/scrapers/test_codeforces.py @@ -17,7 +17,7 @@ def test_scrape_success(mocker, mock_codeforces_html): scraper = CodeforcesScraper() result = scraper.scrape_problem_tests("1900", "A") - assert result.success == True + assert result.success assert len(result.tests) == 1 assert result.tests[0].input == "1\n3\n1 2 3" assert result.tests[0].expected == "6" @@ -39,7 +39,7 @@ def test_scrape_contest_problems(mocker): scraper = CodeforcesScraper() result = scraper.scrape_contest_metadata("1900") - assert result.success == True + assert result.success assert len(result.problems) == 2 assert result.problems[0] == ProblemSummary(id="a", name="A. Problem A") assert result.problems[1] == ProblemSummary(id="b", name="B. Problem B") @@ -56,7 +56,7 @@ def test_scrape_network_error(mocker): scraper = CodeforcesScraper() result = scraper.scrape_problem_tests("1900", "A") - assert result.success == False + assert not result.success assert "network error" in result.error.lower() @@ -80,7 +80,7 @@ def test_scrape_contests_success(mocker): scraper = CodeforcesScraper() result = scraper.scrape_contest_list() - assert result.success == True + assert result.success assert len(result.contests) == 3 assert result.contests[0] == ContestSummary( id="1951", @@ -112,7 +112,7 @@ def test_scrape_contests_api_error(mocker): scraper = CodeforcesScraper() result = scraper.scrape_contest_list() - assert result.success == False + assert not result.success assert "no contests found" in result.error.lower() @@ -127,5 +127,5 @@ def test_scrape_contests_network_error(mocker): scraper = CodeforcesScraper() result = scraper.scrape_contest_list() - assert result.success == False + assert not result.success assert "network error" in result.error.lower() diff --git a/tests/scrapers/test_interface_compliance.py b/tests/scrapers/test_interface_compliance.py index da931c1..753e0de 100644 --- a/tests/scrapers/test_interface_compliance.py +++ b/tests/scrapers/test_interface_compliance.py @@ -135,17 +135,17 @@ class TestScraperInterfaceCompliance: # Test metadata error format result = scraper.scrape_contest_metadata("test") - assert result.success == False + assert not result.success assert result.error.startswith(f"{platform_name}: ") # Test problem tests error format result = scraper.scrape_problem_tests("test", "A") - assert result.success == False + assert not result.success assert result.error.startswith(f"{platform_name}: ") # Test contest list error format result = scraper.scrape_contest_list() - assert result.success == False + assert not result.success assert result.error.startswith(f"{platform_name}: ") @pytest.mark.parametrize("scraper_class", ALL_SCRAPER_CLASSES)