Parent: #297
Goal
Replace the remaining unittest.TestCase-based external (live) test suites with the lighter, plain-pytest smoke-test style established by #318 (tests/external_tests/mlb/test_mlb_smoke.py and tests/external_tests/async_mlb/test_async_mlb_smoke.py).
Background
Most of tests/external_tests/ still uses an older pattern: a unittest.TestCase per resource with a setUpClass that hits the live MLB API once, followed by a long list of assertTrue(hasattr(...)) checks for every model field. This duplicates coverage that already exists offline (Pydantic validation, tests/parsers/, tests/models/), is more brittle to upstream field changes, and is heavier to maintain than the newer smoke tests, which just confirm connectivity and that the response parses into the right type.
Scope
Files currently using the unittest.TestCase pattern that should move to the smoke-test style:
tests/external_tests/attendance/test_attendance.py
tests/external_tests/awards/test_awards.py
tests/external_tests/division/test_division.py
tests/external_tests/drafts/test_draft.py
tests/external_tests/game/test_game.py
tests/external_tests/gamepace/test_gamepace.py
tests/external_tests/homerunderby/test_homerunderby.py
tests/external_tests/league/test_league.py
tests/external_tests/mlb/test_mlb.py
tests/external_tests/mlbdataadapter/test_mlbadapter.py
tests/external_tests/person/test_person.py
tests/external_tests/schedule/test_schedule.py
tests/external_tests/seasons/test_seasons.py
tests/external_tests/sport/test_sport.py
tests/external_tests/standings/test_standings.py
tests/external_tests/stats/test_catching.py
tests/external_tests/stats/test_fielding.py
tests/external_tests/stats/test_hitting.py
tests/external_tests/stats/test_pitching.py
tests/external_tests/stats/test_player_game_stats.py
tests/external_tests/team/test_roster.py
tests/external_tests/team/test_team.py
tests/external_tests/venue/test_venue.py
For each file:
- Replace the
unittest.TestCase class with plain pytest functions, one per endpoint call, matching the shape of test_mlb_smoke.py / test_async_mlb_smoke.py: call the endpoint, assert the return type, and assert one or two representative fields.
- Drop the per-field
hasattr assertions; field-level shape is already the offline suite's job.
- Keep the live IDs/fixtures already in use (e.g. team 133, sport 1, league 103, division 200) so the smoke tests keep exercising the same real resources.
test_mlb.py and test_mlbadapter.py are grab-bag files covering multiple concerns; split their smoke-worthy assertions out per endpoint/resource rather than porting the file as one block.
Constraints
- These suites only run against the live MLB API (
.github/workflows/external-tests.yml, weekly + manual dispatch) and must keep not running as part of the default offline pytest tests/ suite.
- Do not remove live coverage of any endpoint currently exercised; this is a style refactor, not a coverage reduction.
- Before deleting a
hasattr/ValidationError-style assertion, confirm the same field or required-field behavior is already covered by an offline test (tests/parsers/, tests/models/, or similar); file a note here if a gap is found rather than silently dropping coverage.
Acceptance criteria
Refs #297
Parent: #297
Goal
Replace the remaining
unittest.TestCase-based external (live) test suites with the lighter, plain-pytest smoke-test style established by #318 (tests/external_tests/mlb/test_mlb_smoke.pyandtests/external_tests/async_mlb/test_async_mlb_smoke.py).Background
Most of
tests/external_tests/still uses an older pattern: aunittest.TestCaseper resource with asetUpClassthat hits the live MLB API once, followed by a long list ofassertTrue(hasattr(...))checks for every model field. This duplicates coverage that already exists offline (Pydantic validation,tests/parsers/,tests/models/), is more brittle to upstream field changes, and is heavier to maintain than the newer smoke tests, which just confirm connectivity and that the response parses into the right type.Scope
Files currently using the
unittest.TestCasepattern that should move to the smoke-test style:tests/external_tests/attendance/test_attendance.pytests/external_tests/awards/test_awards.pytests/external_tests/division/test_division.pytests/external_tests/drafts/test_draft.pytests/external_tests/game/test_game.pytests/external_tests/gamepace/test_gamepace.pytests/external_tests/homerunderby/test_homerunderby.pytests/external_tests/league/test_league.pytests/external_tests/mlb/test_mlb.pytests/external_tests/mlbdataadapter/test_mlbadapter.pytests/external_tests/person/test_person.pytests/external_tests/schedule/test_schedule.pytests/external_tests/seasons/test_seasons.pytests/external_tests/sport/test_sport.pytests/external_tests/standings/test_standings.pytests/external_tests/stats/test_catching.pytests/external_tests/stats/test_fielding.pytests/external_tests/stats/test_hitting.pytests/external_tests/stats/test_pitching.pytests/external_tests/stats/test_player_game_stats.pytests/external_tests/team/test_roster.pytests/external_tests/team/test_team.pytests/external_tests/venue/test_venue.pyFor each file:
unittest.TestCaseclass with plain pytest functions, one per endpoint call, matching the shape oftest_mlb_smoke.py/test_async_mlb_smoke.py: call the endpoint, assert the return type, and assert one or two representative fields.hasattrassertions; field-level shape is already the offline suite's job.test_mlb.pyandtest_mlbadapter.pyare grab-bag files covering multiple concerns; split their smoke-worthy assertions out per endpoint/resource rather than porting the file as one block.Constraints
.github/workflows/external-tests.yml, weekly + manual dispatch) and must keep not running as part of the default offlinepytest tests/suite.hasattr/ValidationError-style assertion, confirm the same field or required-field behavior is already covered by an offline test (tests/parsers/,tests/models/, or similar); file a note here if a gap is found rather than silently dropping coverage.Acceptance criteria
unittest.TestCasetests/external_tests/still only runs via the external-tests workflow, not the default suiteRefs #297