-
Notifications
You must be signed in to change notification settings - Fork 348
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix logic for determining if team is Home or Away for team game logs (#…
…237) * Fix buglet * Added tests
- Loading branch information
Showing
2 changed files
with
13 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import pybaseball | ||
|
||
|
||
def test_nyy_game_logs_regression1() -> None: | ||
"""Regression test for NYY 2021 example""" | ||
df = pybaseball.team_game_logs(2021, "NYY", "pitching") | ||
|
||
# NYY home against TOR 9/9/2021 | ||
assert df.loc[139]["Home"] | ||
|
||
# subway series 9/11/2021, NYY playing Mets @ Citi (NYY is Away) | ||
assert not df.loc[141]["Home"] |