jenkins-bot submitted this change.

View Change

Approvals: Zhuyifei1999: Looks good to me, approved jenkins-bot: Verified
[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(-)

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

To view, visit change 610811. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I13b723dc171b5c22091534f7aa7267dde25fa22b
Gerrit-Change-Number: 610811
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Zhuyifei1999 <zhuyifei1999@gmail.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged