Skip to content

Commit cc71014

Browse files
authored
Fix players season totals last row is league average row (#292)
1 parent 2320dfd commit cc71014

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+285652
-808
lines changed

basketball_reference_web_scraper/html.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def rows_query(self):
284284
//table[@id='totals_stats']
285285
/tbody
286286
/tr[
287-
not(contains(@class, 'thead')) or
287+
not(contains(@class, 'thead')) and
288288
not(contains(@class, 'norank'))
289289
]
290290
"""

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "basketball_reference_web_scraper"
3-
version = "4.15.1"
3+
version = "4.15.2"
44
description = "A Basketball Reference client that generates data by scraping the website"
55
authors = ["Jae Bradley <jae.b.bradley@gmail.com>"]
66
maintainers = ["Jae Bradley <jae.b.bradley@gmail.com>"]

scripts/build.sh

-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ function main() {
4040

4141
# TODO: @jaebradley re-enable integration pytests
4242
"${poetry_program_path}" run coverage run --source=basketball_reference_web_scraper --module pytest \
43-
--ignore "./tests/integration/client/test_player_season_totals.py" \
44-
--ignore "./tests/integration/client/test_players_season_totals.py" \
4543
--ignore "./tests/integration/client/test_search.py" \
4644
--ignore "./tests/integration/client/test_season_schedule.py" \
4745
--ignore "./tests/integration/client/test_standings.py" \

tests/end to end/test_client.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from unittest import TestCase
66

77
from basketball_reference_web_scraper.client import player_box_scores, season_schedule, players_advanced_season_totals, \
8-
play_by_play
8+
play_by_play, players_season_totals
99
from basketball_reference_web_scraper.data import Location, Outcome
1010
from basketball_reference_web_scraper.data import OutputWriteOption, OutputType, Team, PeriodType
1111

@@ -192,3 +192,13 @@ def test_overtime_play_by_play_to_json_file(self):
192192
os.path.dirname(__file__),
193193
"./output/expected/2018_10_22_POR_pbp.json",
194194
)))
195+
196+
197+
class TestPlayersSeasonTotals(TestCase):
198+
199+
def test_2018(self):
200+
totals = players_season_totals(season_end_year=2018)
201+
202+
for total in totals:
203+
self.assertIsNot("", total["name"])
204+
self.assertIsNot("League Average", total["name"])

tests/integration/client/output/expected/players_season_totals/2001.csv

+491
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)