jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/385024 )
Change subject: [test] Replace expected_failure_if with skipIf decorator
......................................................................
[test] Replace expected_failure_if with skipIf decorator
unittest's expected failure decorators are handy when a bug was
identified in the code but wasn't fixed yet in the current release.
The different behavior of py2 and py3 related to string elements
which aren't string constants cannot be solved because it is an
upstream problem and part of the release difference issue.
Therefore we shouldn't use that expected failure reminder but just
skip the test for py3.
Bug: T178528
Change-Id: I40fce5d7a4605fcc1b2cdd7b811c31eef53d4a2c
---
M tests/tools_tests.py
1 file changed, 5 insertions(+), 5 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
Zoranzoki21: Looks good to me, but someone else must approve
diff --git a/tests/tools_tests.py b/tests/tools_tests.py
index be7acc0..791ab57 100644
--- a/tests/tools_tests.py
+++ b/tests/tools_tests.py
@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
"""Test tools package alone which don't fit into other tests."""
#
-# (C) Pywikibot team, 2016
+# (C) Pywikibot team, 2016-2017
#
# Distributed under the terms of the MIT license.
from __future__ import absolute_import, unicode_literals
@@ -29,7 +29,7 @@
unittest, require_modules, DeprecationTestCase, TestCase, MetaTestCaseClass
)
-from tests.utils import expected_failure_if, add_metaclass
+from tests.utils import add_metaclass
class ContextManagerWrapperTestCase(TestCase):
@@ -573,10 +573,10 @@
deduper = tools.filter_unique(self.strs, container=deduped, key=hash)
self._test_dedup_str(deduped, deduper, hash)
- @expected_failure_if(not tools.PY2)
+ @unittest.skipIf(not tools.PY2,
+ 'str in Py3 behave like objects and id as key fails')
def test_str_id(self):
- """Test str using id as key fails on Python 3."""
- # str in Python 3 behave like objects.
+ """Test str using id as key."""
deduped = set()
deduper = tools.filter_unique(self.strs, container=deduped, key=id)
self._test_dedup_str(deduped, deduper, id)
--
To view, visit https://gerrit.wikimedia.org/r/385024
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I40fce5d7a4605fcc1b2cdd7b811c31eef53d4a2c
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Magul <tomasz.magulski(a)gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: Zoranzoki21 <zorandori4444(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>