jenkins-bot has submitted this change and it was merged.
Change subject: Require 2.7+ for one wikibase test ......................................................................
Require 2.7+ for one wikibase test
In certain circumstances a Wikibase method toJSON will fail on py 2.6. It is currently causing the travis builds to fail.
Bug: 70707 Change-Id: I2fb86d36f35214c48362ac96279070cb0e813ba3 --- M pywikibot/page.py M tests/wikibase_tests.py 2 files changed, 9 insertions(+), 1 deletion(-)
Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py index 1ba050e..d3f7f14 100644 --- a/pywikibot/page.py +++ b/pywikibot/page.py @@ -2973,8 +2973,10 @@ *ItemPage.setSitelinks
@param data: Data to be saved - @type data: dict + @type data: dict (must be not None for python 2.6; bug 70707) """ + assert(sys.version_info >= (2, 7) or data is not None) + if hasattr(self, 'lastrevid'): baserevid = self.lastrevid else: diff --git a/tests/wikibase_tests.py b/tests/wikibase_tests.py index 1c0289f..072b8bf 100644 --- a/tests/wikibase_tests.py +++ b/tests/wikibase_tests.py @@ -9,6 +9,7 @@ #
import os +import sys import pywikibot from pywikibot import pagegenerators from pywikibot.page import WikibasePage @@ -827,6 +828,11 @@
"""Test cases to test toJSON() functions."""
+ @classmethod + def setUpClass(cls): + if not sys.version_info >= (2, 7): + raise unittest.SkipTest("Fails on Python 2.6") + def setUp(self): super(TestJSON, self).setUp() wikidata = self.get_repo()
pywikibot-commits@lists.wikimedia.org