jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/610811 )
Change subject: [4.0] Remove Python 2 related code from tools_formatter_tests.py ......................................................................
[4.0] Remove Python 2 related code from tools_formatter_tests.py
Change-Id: I13b723dc171b5c22091534f7aa7267dde25fa22b --- M tests/tools_formatter_tests.py 1 file changed, 6 insertions(+), 9 deletions(-)
Approvals: Zhuyifei1999: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/tools_formatter_tests.py b/tests/tools_formatter_tests.py index 4a4ebcd..ef0f66d 100644 --- a/tests/tools_formatter_tests.py +++ b/tests/tools_formatter_tests.py @@ -1,14 +1,13 @@ # -*- coding: utf-8 -*- """Tests for the C{pywikibot.tools.formatter} module.""" # -# (C) Pywikibot team, 2015-2018 +# (C) Pywikibot team, 2015-2020 # # Distributed under the terms of the MIT license. # -from __future__ import absolute_import, division, unicode_literals +from contextlib import suppress
from pywikibot.tools import formatter -from pywikibot.tools import UnicodeMixin
from tests.aspects import unittest, TestCase
@@ -35,11 +34,11 @@
"""Test color_format function in bot module."""
- class DummyUnicode(UnicodeMixin): + class DummyUnicode:
- """Dummy class that __unicode__ returns a non-ascii unicode value.""" + """Dummy class that __str__ returns a non-ascii unicode value."""
- def __unicode__(self): + def __str__(self): """Return ä.""" return 'ä'
@@ -109,7 +108,5 @@
if __name__ == '__main__': # pragma: no cover - try: + with suppress(SystemExit): unittest.main() - except SystemExit: - pass