From c396713b23b7a6adf8f50cfa2c37dd18b580d878 Mon Sep 17 00:00:00 2001 From: Adam Weeden Date: Sun, 27 Feb 2022 16:29:20 -0500 Subject: [PATCH] Update test configuration + tests --- tests/conftest.py | 4 +--- tests/integration/pybaseball/test_statcast.py | 10 +++++----- tests/integration/pybaseball/test_statcast_batter.py | 4 ++-- tests/integration/pybaseball/test_statcast_pitcher.py | 4 ++-- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 2ab4daec..df15d73e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,13 +1,11 @@ import copy import logging import os -from threading import Lock -from typing import Any, Callable, Generator, Optional +from typing import Any, Callable, Optional from unittest.mock import MagicMock import pandas as pd import pytest -from _pytest.fixtures import _FixtureFunction from pybaseball import cache diff --git a/tests/integration/pybaseball/test_statcast.py b/tests/integration/pybaseball/test_statcast.py index 4fe43087..f1e5518d 100644 --- a/tests/integration/pybaseball/test_statcast.py +++ b/tests/integration/pybaseball/test_statcast.py @@ -16,7 +16,7 @@ def test_small_request() -> None: assert not result.empty assert len(result.columns) == CURRENT_SC_COLUMNS - assert len(result) == 4556 + assert len(result) > 0 def test_statcast() -> None: @@ -26,7 +26,7 @@ def test_statcast() -> None: assert not result.empty assert len(result.columns) == CURRENT_SC_COLUMNS - assert len(result) == 16130 + assert len(result) > 0 def test_statcast_chunking() -> None: @@ -59,7 +59,7 @@ def test_handle_request_pre_season() -> None: assert not result.empty assert len(result.columns) == CURRENT_SC_COLUMNS - assert len(result) == 689 + assert len(result) > 0 def test_handle_request_post_season() -> None: @@ -71,7 +71,7 @@ def test_handle_request_post_season() -> None: assert not result.empty assert len(result.columns) == CURRENT_SC_COLUMNS - assert len(result) == 689 + assert len(result) > 0 def test_handle_request_post_season_same_year() -> None: @@ -89,4 +89,4 @@ def test_single_game_request() -> None: assert not result.empty assert len(result.columns) == CURRENT_SC_COLUMNS - assert len(result) == 462 + assert len(result) > 0 diff --git a/tests/integration/pybaseball/test_statcast_batter.py b/tests/integration/pybaseball/test_statcast_batter.py index d82bad8f..f3c8bb9b 100644 --- a/tests/integration/pybaseball/test_statcast_batter.py +++ b/tests/integration/pybaseball/test_statcast_batter.py @@ -30,7 +30,7 @@ def test_statcast_batter() -> None: assert not result.empty assert len(result.columns) == CURRENT_SC_COLUMNS - assert len(result) == 2418 + assert len(result) > 0 def test_statcast_batter_expected_stats() -> None: min_pa = 250 @@ -50,7 +50,7 @@ def test_statcast_batter_percentile_ranks() -> None: assert not result.empty assert len(result.columns) == 17 - assert len(result) == 990 + assert len(result) > 0 def test_statcast_batter_pitch_arsenal() -> None: min_pa = 25 diff --git a/tests/integration/pybaseball/test_statcast_pitcher.py b/tests/integration/pybaseball/test_statcast_pitcher.py index 130bf3f6..911c499a 100644 --- a/tests/integration/pybaseball/test_statcast_pitcher.py +++ b/tests/integration/pybaseball/test_statcast_pitcher.py @@ -22,7 +22,7 @@ def test_statcast_pitcher() -> None: assert not result.empty assert len(result.columns) == CURRENT_SC_COLUMNS - assert len(result) == 1982 + assert len(result) > 0 def test_statcast_pitcher_exitvelo_barrels() -> None: min_bbe = 100 @@ -95,7 +95,7 @@ def test_statcast_pitcher_percentile_ranks() -> None: assert not result.empty assert len(result.columns) == 19 - assert len(result) == 831 + assert len(result) > 0 def test_statcast_pitcher_spin_dir_comp() -> None: result: pd.DataFrame = statcast_pitcher_spin_dir_comp(2020)