jenkins-bot has submitted this change and it was merged.
Change subject: Fix wikibase 2.6 tests
......................................................................
Fix wikibase 2.6 tests
Use %s and %r to format numbers in a format that corresponds
to the format actually used while formatting (i.e. str() and
repr())
Change-Id: I50d0632606f413c9b5e32341dece2cf9d3eb2a21
---
M tests/wikibase_tests.py
1 file changed, 5 insertions(+), 5 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/wikibase_tests.py b/tests/wikibase_tests.py
index 7422f14..5a29ca6 100644
--- a/tests/wikibase_tests.py
+++ b/tests/wikibase_tests.py
@@ -77,12 +77,12 @@
'upperBound': 0.044405586, 'unit': '1',
})
# test other WbQuantity methods
self.assertEqual("%s" % q,
- "{'amount': 0.044405586, 'lowerBound':
0.044405586, "
- "'unit': '1', 'upperBound':
0.044405586}")
+ "{'amount': %(val)r, 'lowerBound': %(val)r,
"
+ "'unit': '1', 'upperBound':
%(val)r}" % {'val': 0.044405586})
self.assertEqual("%r" % q,
- "WbQuantity(amount=0.044405586, "
- "upperBound=0.044405586, lowerBound=0.044405586, "
- "unit=1)")
+ "WbQuantity(amount=%(val)s, "
+ "upperBound=%(val)s, lowerBound=%(val)s, "
+ "unit=1)" % {'val': 0.044405586})
self.assertEqual(q, q)
# test WbQuantity.fromWikibase() instantiating
--
To view, visit
https://gerrit.wikimedia.org/r/143153
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I50d0632606f413c9b5e32341dece2cf9d3eb2a21
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>