Skip to content

Commit

Permalink
Fix team ID lookup stuff etc
Browse files Browse the repository at this point in the history
  • Loading branch information
schorrm committed Jun 16, 2024
1 parent 41547e2 commit 9af14d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pybaseball/teamid_lookup.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def _front_loaded_ratio(str_1: str, str_2: str) -> float:
'''

if len(str_1) != 3 or len(str_2) != 3:
logger.warn(
logger.warning(
"This ratio is intended for 3 length string comparison (such as a lahman teamID, franchID, or teamIDBR."
"Returning 0 for non-compliant string(s)."
)
Expand Down
3 changes: 2 additions & 1 deletion tests/pybaseball/test_teamid_lookup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pandas as pd
import pytest
import warnings

from pybaseball.teamid_lookup import _front_loaded_ratio, _get_close_team_matches, team_ids

Expand Down Expand Up @@ -66,7 +67,7 @@ def test_front_loaded_ratio(team1: str, team2: str, expected_ratio: int) -> None
if len(team1) == 3 and len(team2) == 3:
assert round(_front_loaded_ratio(team1, team2), 2) == expected_ratio
else:
with pytest.warns(None):
with warnings.catch_warnings(record=True):
assert _front_loaded_ratio(team1, team2) == 0

def test_get_close_team_matches() -> None:
Expand Down

0 comments on commit 9af14d3

Please sign in to comment.