Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test configuration + tests #252

Merged
merged 1 commit into from
Feb 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
10 changes: 5 additions & 5 deletions tests/integration/pybaseball/test_statcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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
4 changes: 2 additions & 2 deletions tests/integration/pybaseball/test_statcast_batter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/pybaseball/test_statcast_pitcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down