jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1101087?usp=email )
Change subject: cleanup: remove MediaWiki dependencies in wbtypes_tests and wikibase_edit_tests ......................................................................
cleanup: remove MediaWiki dependencies in wbtypes_tests and wikibase_edit_tests
Bug: T378984 Change-Id: Icacab46b530e264db4c0d8bd2dc80b99e85bc6b8 --- M tests/wbtypes_tests.py M tests/wikibase_edit_tests.py 2 files changed, 0 insertions(+), 34 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/wbtypes_tests.py b/tests/wbtypes_tests.py index e3cf190..dff7846 100755 --- a/tests/wbtypes_tests.py +++ b/tests/wbtypes_tests.py @@ -15,7 +15,6 @@
import pywikibot from pywikibot.page import ItemPage, Page -from pywikibot.tools import MediaWikiVersion from tests.aspects import WikidataTestCase
@@ -695,13 +694,9 @@ """Override setup to store repo and it's version.""" super().setUp() self.repo = self.get_repo() - self.version = self.repo.mw_version
def test_WbQuantity_unbound(self): """Test WbQuantity for value without bounds.""" - if self.version < MediaWikiVersion('1.29.0-wmf.2'): - self.skipTest('Wiki version must be 1.29.0-wmf.2 or newer to ' - 'support unbound uncertainties.') q = pywikibot.WbQuantity(amount=1234.5, site=self.repo) self.assertEqual(q.toWikibase(), {'amount': '+1234.5', 'unit': '1', @@ -709,9 +704,6 @@
def test_WbQuantity_formatting_unbound(self): """Test WbQuantity formatting without bounds.""" - if self.version < MediaWikiVersion('1.29.0-wmf.2'): - self.skipTest('Wiki version must be 1.29.0-wmf.2 or newer to ' - 'support unbound uncertainties.') q = pywikibot.WbQuantity(amount='0.044405586', site=self.repo) self.assertEqual(str(q), '{{\n' @@ -727,9 +719,6 @@
def test_WbQuantity_fromWikibase_unbound(self): """Test WbQuantity.fromWikibase() instantiating without bounds.""" - if self.version < MediaWikiVersion('1.29.0-wmf.2'): - self.skipTest('Wiki version must be 1.29.0-wmf.2 or newer to ' - 'support unbound uncertainties.') q = pywikibot.WbQuantity.fromWikibase({'amount': '+0.0229', 'unit': '1'}, site=self.repo) @@ -739,10 +728,6 @@
def test_WbQuantity_ItemPage_unit(self): """Test WbQuantity with ItemPage unit.""" - if self.version < MediaWikiVersion('1.28-wmf.23'): - self.skipTest('Wiki version must be 1.28-wmf.23 or newer to ' - 'expose wikibase-conceptbaseuri.') - q = pywikibot.WbQuantity(amount=1234, error=1, unit=pywikibot.ItemPage(self.repo, 'Q712226')) self.assertEqual(q.toWikibase(), @@ -752,10 +737,6 @@
def test_WbQuantity_equality(self): """Test WbQuantity equality with different unit representations.""" - if self.version < MediaWikiVersion('1.28-wmf.23'): - self.skipTest('Wiki version must be 1.28-wmf.23 or newer to ' - 'expose wikibase-conceptbaseuri.') - a = pywikibot.WbQuantity( amount=1234, error=1, unit=pywikibot.ItemPage(self.repo, 'Q712226')) diff --git a/tests/wikibase_edit_tests.py b/tests/wikibase_edit_tests.py index 338db40..aa1ef5e 100755 --- a/tests/wikibase_edit_tests.py +++ b/tests/wikibase_edit_tests.py @@ -296,11 +296,6 @@ testsite = self.get_repo() item = self._clean_item(testsite, 'P20480')
- # Make sure the wiki supports wikibase-conceptbaseuri - if testsite.mw_version < '1.29.0-wmf.2': - self.skipTest('Wiki version must be 1.29.0-wmf.2 or newer to ' - 'support unbound uncertainties.') - # set new claim claim = pywikibot.page.Claim(testsite, 'P20480', datatype='globe-coordinate') @@ -320,11 +315,6 @@ testsite = self.get_repo() item = self._clean_item(testsite, 'P69')
- # Make sure the wiki supports unbound uncertainties - if testsite.mw_version < '1.29.0-wmf.2': - self.skipTest('Wiki version must be 1.29.0-wmf.2 or newer to ' - 'support unbound uncertainties.') - # set new claim claim = pywikibot.page.Claim(testsite, 'P69', datatype='quantity') target = pywikibot.WbQuantity(amount=1234) @@ -342,11 +332,6 @@ testsite = self.get_repo() item = self._clean_item(testsite, 'P69')
- # Make sure the wiki supports wikibase-conceptbaseuri - if testsite.mw_version < '1.28-wmf.23': - self.skipTest('Wiki version must be 1.28-wmf.23 or newer to ' - 'expose wikibase-conceptbaseuri.') - # set new claim claim = pywikibot.page.Claim(testsite, 'P69', datatype='quantity') target = pywikibot.WbQuantity(amount=1234, error=1, unit=item)
pywikibot-commits@lists.wikimedia.org