jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/647614 )
Change subject: [cleanup] Remove deprecatd Property.get_type() ......................................................................
[cleanup] Remove deprecatd Property.get_type()
Change-Id: I36b0e6689c04f51417d34a2a893f1afde749e909 --- M pywikibot/page/__init__.py M tests/wikibase_tests.py 2 files changed, 1 insertion(+), 18 deletions(-)
Approvals: Mpaa: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/page/__init__.py b/pywikibot/page/__init__.py index 8e6fe80..ad2036d 100644 --- a/pywikibot/page/__init__.py +++ b/pywikibot/page/__init__.py @@ -4743,20 +4743,6 @@ self._type = self.repo.getPropertyType(self) return self._type
- @deprecated('Property.type', since='20140607', future_warning=True) - def getType(self): # pragma: no cover - """ - Return the type of this property. - - It returns 'globecoordinate' for type 'globe-coordinate' - in order to be backwards compatible. See - https://gerrit.wikimedia.org/r/#/c/135405/ for background. - """ - if self.type == 'globe-coordinate': - return 'globecoordinate' - else: - return self._type - def getID(self, numeric=False): """ Get the identifier of this property. diff --git a/tests/wikibase_tests.py b/tests/wikibase_tests.py index e485ea9..14d8ab5 100644 --- a/tests/wikibase_tests.py +++ b/tests/wikibase_tests.py @@ -19,7 +19,7 @@ ClaimCollection, SiteLinkCollection, ) from pywikibot.site import Namespace, NamespacesDict -from pywikibot.tools import MediaWikiVersion, suppress_warnings +from pywikibot.tools import MediaWikiVersion
from tests import join_pages_path, mock from tests.aspects import ( @@ -1375,17 +1375,14 @@ with self.assertRaisesRegex(pywikibot.InvalidTitle, regex): PropertyPage(wikidata, title='')
- @suppress_warnings('pywikibot.page.Property.getType is deprecated') def test_globe_coordinate(self): """Test a coordinate PropertyPage has the correct type.""" wikidata = self.get_repo() property_page = PropertyPage(wikidata, 'P625') self.assertEqual(property_page.type, 'globe-coordinate') - self.assertEqual(property_page.getType(), 'globecoordinate')
claim = pywikibot.Claim(wikidata, 'P625') self.assertEqual(claim.type, 'globe-coordinate') - self.assertEqual(claim.getType(), 'globecoordinate')
def test_get(self): """Test PropertyPage.get() method."""