Skip to content

Commit

Permalink
Merge pull request #395 from roclark/remove-attempted-passes
Browse files Browse the repository at this point in the history
Remove attempted_passes from NCAAF
  • Loading branch information
roclark committed Apr 12, 2020
2 parents 2ea321d + 6149485 commit f5dd33d
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 53 deletions.
12 changes: 0 additions & 12 deletions sportsreference/ncaaf/player.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import pandas as pd
import re
import warnings
from functools import wraps
from lxml.etree import ParserError, XMLSyntaxError
from pyquery import PyQuery as pq
Expand Down Expand Up @@ -212,17 +211,6 @@ def completed_passes(self):
"""
return self._completed_passes

@_int_property_decorator
def attempted_passes(self):
"""
Returns an ``int`` of the number of passes the player attempted.
"""
warnings.warn('Warning: "attempted_passes" is deprecated and will '
'be removed in a future release. Please use '
'"pass_attempts" instead for identical functionality.',
DeprecationWarning)
return self._pass_attempts

@_int_property_decorator
def pass_attempts(self):
"""
Expand Down
12 changes: 0 additions & 12 deletions sportsreference/ncaaf/roster.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import pandas as pd
import re
import warnings
from functools import wraps
from lxml.etree import ParserError, XMLSyntaxError
from pyquery import PyQuery as pq
Expand Down Expand Up @@ -524,17 +523,6 @@ def completed_passes(self):
"""
return self._completed_passes

@_int_property_decorator
def attempted_passes(self):
"""
Returns an ``int`` of the number of passes the player attempted.
"""
warnings.warn('Warning: "attempted_passes" is deprecated and will '
'be removed in a future release. Please use '
'"pass_attempts" instead for identical functionality.',
DeprecationWarning)
return self._pass_attempts

@_int_property_decorator
def pass_attempts(self):
"""
Expand Down
16 changes: 0 additions & 16 deletions tests/unit/test_ncaaf_boxscore.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,22 +435,6 @@ def test_non_int_value_returns_none(self):

assert self.boxscore.away_rush_attempts is None

@patch('requests.get', side_effect=mock_pyquery)
def test_attempted_passes_has_deprecation_warning(self, *args, **kwargs):
flexmock(AbstractPlayer) \
.should_receive('__init__') \
.and_return(None)
mock_passes = PropertyMock(return_value=[32])
mock_index = PropertyMock(return_value=0)
player = AbstractPlayer(None, None, None)
type(player)._pass_attempts = mock_passes
type(player)._index = mock_index

with pytest.deprecated_call():
result = player.attempted_passes

assert result == 32


class TestNCAABBoxscores:
@patch('requests.get', side_effect=mock_pyquery)
Expand Down
13 changes: 0 additions & 13 deletions tests/unit/test_ncaaf_roster.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,3 @@ def test_missing_weight_returns_none(self, *args, **kwargs):
result = player.weight

assert result is None

@patch('requests.get', side_effect=mock_pyquery)
def test_attempted_passes_has_deprecation_warning(self, *args, **kwargs):
mock_passes = PropertyMock(return_value=[32])
mock_index = PropertyMock(return_value=0)
player = Player(None)
type(player)._pass_attempts = mock_passes
type(player)._index = mock_index

with pytest.deprecated_call():
result = player.attempted_passes

assert result == 32

0 comments on commit f5dd33d

Please sign in to comment.