jenkins-bot submitted this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
Changed import preference for unittest in certain scripts

Bug: T272235
Change-Id: Ie5605483f2e8bf3c8e8f407f67f5ea9b7a4b069c
---
M tests/add_text_tests.py
M tests/archivebot_tests.py
M tests/basepage.py
M tests/cache_tests.py
M tests/category_tests.py
M tests/checkimages_tests.py
M tests/compat2core_tests.py
M tests/cosmetic_changes_tests.py
M tests/data_ingestion_tests.py
M tests/date_tests.py
M tests/deletionbot_tests.py
M tests/deprecation_tests.py
M tests/disambredir_tests.py
M tests/djvu_tests.py
M tests/dry_site_tests.py
M tests/echo_tests.py
M tests/edit_failure_tests.py
M tests/edit_tests.py
M tests/eventstreams_tests.py
M tests/fixes_tests.py
M tests/flow_edit_tests.py
M tests/flow_tests.py
M tests/flow_thanks_tests.py
M tests/redirect_bot_tests.py
M tests/reflinks_tests.py
M tests/replacebot_tests.py
M tests/script_tests.py
M tests/site_decorators_tests.py
M tests/site_detect_tests.py
M tests/siteinfo_tests.py
M tests/sparql_tests.py
M tests/template_bot_tests.py
M tests/tests_tests.py
M tests/textlib_tests.py
M tests/thanks_tests.py
M tests/thread_tests.py
36 files changed, 132 insertions(+), 73 deletions(-)

diff --git a/tests/add_text_tests.py b/tests/add_text_tests.py
index fb55f41..fed38c4 100644
--- a/tests/add_text_tests.py
+++ b/tests/add_text_tests.py
@@ -1,15 +1,17 @@
# -*- coding: utf-8 -*-
"""Test add_text bot module."""
#
-# (C) Pywikibot team, 2016-2020
+# (C) Pywikibot team, 2016-2021
#
# Distributed under the terms of the MIT license.
#
+import unittest
+
import pywikibot

from scripts.add_text import add_text, get_text

-from tests.aspects import unittest, TestCase
+from tests.aspects import TestCase


class TestAdding(TestCase):
diff --git a/tests/archivebot_tests.py b/tests/archivebot_tests.py
index ec63a06..e003172 100644
--- a/tests/archivebot_tests.py
+++ b/tests/archivebot_tests.py
@@ -1,10 +1,12 @@
# -*- coding: utf-8 -*-
"""Tests for archivebot scripts."""
#
-# (C) Pywikibot team, 2014-2020
+# (C) Pywikibot team, 2014-2021
#
# Distributed under the terms of the MIT license.
#
+import unittest
+
from contextlib import suppress
from datetime import datetime, timedelta

@@ -16,7 +18,7 @@

from scripts import archivebot

-from tests.aspects import unittest, TestCase
+from tests.aspects import TestCase


THREADS = {
diff --git a/tests/basepage.py b/tests/basepage.py
index b072249..f4eb117 100644
--- a/tests/basepage.py
+++ b/tests/basepage.py
@@ -1,15 +1,17 @@
# -*- coding: utf-8 -*-
"""Tests for BasePage subclasses."""
#
-# (C) Pywikibot team, 2015-2020
+# (C) Pywikibot team, 2015-2021
#
# Distributed under the terms of the MIT license.
#
+import unittest
+
from contextlib import suppress

from pywikibot.page import BasePage

-from tests.aspects import unittest, TestCase
+from tests.aspects import TestCase


class BasePageTestBase(TestCase):
diff --git a/tests/cache_tests.py b/tests/cache_tests.py
index 06e82c6..9dae926 100644
--- a/tests/cache_tests.py
+++ b/tests/cache_tests.py
@@ -1,16 +1,18 @@
# -*- coding: utf-8 -*-
"""API Request cache tests."""
#
-# (C) Pywikibot team, 2012-2020
+# (C) Pywikibot team, 2012-2021
#
# Distributed under the terms of the MIT license.
#
+import unittest
+
from pywikibot.site import BaseSite

import scripts.maintenance.cache as cache

+from tests.aspects import TestCase
from tests import join_cache_path
-from tests.aspects import unittest, TestCase


class RequestCacheTests(TestCase):
diff --git a/tests/category_tests.py b/tests/category_tests.py
index e25a5d1..f250e71 100644
--- a/tests/category_tests.py
+++ b/tests/category_tests.py
@@ -1,16 +1,18 @@
# -*- coding: utf-8 -*-
"""Tests for the Category class."""
#
-# (C) Pywikibot team, 2014-2020
+# (C) Pywikibot team, 2014-2021
#
# Distributed under the terms of the MIT license.
#
+import unittest
+
from contextlib import suppress

import pywikibot
import pywikibot.page

-from tests.aspects import unittest, TestCase
+from tests.aspects import TestCase


class TestCategoryObject(TestCase):
diff --git a/tests/checkimages_tests.py b/tests/checkimages_tests.py
index 1616d5e..9b064ab 100644
--- a/tests/checkimages_tests.py
+++ b/tests/checkimages_tests.py
@@ -2,13 +2,15 @@
# -*- coding: utf-8 -*-
"""Unit tests for checkimages script."""
#
-# (C) Pywikibot team, 2015-2020
+# (C) Pywikibot team, 2015-2021
#
# Distributed under the terms of the MIT license.
#
+import unittest
+
from scripts import checkimages

-from tests.aspects import unittest, TestCase
+from tests.aspects import TestCase


class TestSettings(TestCase):
diff --git a/tests/compat2core_tests.py b/tests/compat2core_tests.py
index 6147375..9db0380 100644
--- a/tests/compat2core_tests.py
+++ b/tests/compat2core_tests.py
@@ -1,13 +1,15 @@
# -*- coding: utf-8 -*-
"""compat2core.py tests."""
#
-# (C) Pywikibot team, 2019-2020
+# (C) Pywikibot team, 2019-2021
#
# Distributed under the terms of the MIT license.
#
+import unittest
+
import scripts.maintenance.compat2core as c2c

-from tests.aspects import unittest, TestCase
+from tests.aspects import TestCase


class Compat2CoreTests(TestCase):
diff --git a/tests/cosmetic_changes_tests.py b/tests/cosmetic_changes_tests.py
index d9be2b4..8d18748 100644
--- a/tests/cosmetic_changes_tests.py
+++ b/tests/cosmetic_changes_tests.py
@@ -1,15 +1,17 @@
# -*- coding: utf-8 -*-
"""Test cosmetic_changes module."""
#
-# (C) Pywikibot team, 2015-2020
+# (C) Pywikibot team, 2015-2021
#
# Distributed under the terms of the MIT license.
#
+import unittest
+
from contextlib import suppress

from pywikibot.cosmetic_changes import CosmeticChangesToolkit

-from tests.aspects import unittest, TestCase
+from tests.aspects import TestCase


class TestCosmeticChanges(TestCase):
diff --git a/tests/data_ingestion_tests.py b/tests/data_ingestion_tests.py
index 41fcdce..d94949c 100644
--- a/tests/data_ingestion_tests.py
+++ b/tests/data_ingestion_tests.py
@@ -2,14 +2,16 @@
# -*- coding: utf-8 -*-
"""Unit tests for data_ingestion.py script."""
#
-# (C) Pywikibot team, 2012-2020
+# (C) Pywikibot team, 2012-2021
#
# Distributed under the terms of the MIT license.
#
+import unittest
+
from scripts import data_ingestion

from tests import join_data_path, join_images_path
-from tests.aspects import unittest, TestCase, ScriptMainTestCase
+from tests.aspects import TestCase, ScriptMainTestCase
from tests.utils import empty_sites


diff --git a/tests/date_tests.py b/tests/date_tests.py
index 6180e4a..c0ac519 100644
--- a/tests/date_tests.py
+++ b/tests/date_tests.py
@@ -1,16 +1,18 @@
# -*- coding: utf-8 -*-
"""Tests for the date module."""
#
-# (C) Pywikibot team, 2012-2020
+# (C) Pywikibot team, 2012-2021
#
# Distributed under the terms of the MIT license.
#
+import unittest
+
from contextlib import suppress
from datetime import datetime

from pywikibot import date

-from tests.aspects import unittest, MetaTestCaseClass, TestCase
+from tests.aspects import MetaTestCaseClass, TestCase


class TestDateMeta(MetaTestCaseClass):
diff --git a/tests/deletionbot_tests.py b/tests/deletionbot_tests.py
index 25b8a8c..14282aa 100644
--- a/tests/deletionbot_tests.py
+++ b/tests/deletionbot_tests.py
@@ -1,10 +1,12 @@
# -*- coding: utf-8 -*-
"""Tests for scripts/delete.py."""
#
-# (C) Pywikibot team, 2014-2020
+# (C) Pywikibot team, 2014-2021
#
# Distributed under the terms of the MIT license.
#
+import unittest
+
from contextlib import suppress

import pywikibot
@@ -12,7 +14,7 @@

from scripts import delete

-from tests.aspects import unittest, ScriptMainTestCase
+from tests.aspects import ScriptMainTestCase
from tests.utils import empty_sites


diff --git a/tests/deprecation_tests.py b/tests/deprecation_tests.py
index 3c4d84e..4fbc5ce 100644
--- a/tests/deprecation_tests.py
+++ b/tests/deprecation_tests.py
@@ -1,17 +1,19 @@
# -*- coding: utf-8 -*-
"""Tests for deprecation tools."""
#
-# (C) Pywikibot team, 2014-2020
+# (C) Pywikibot team, 2014-2021
#
# Distributed under the terms of the MIT license.
#
+import unittest
+
from contextlib import suppress

from pywikibot.tools import (
deprecated, deprecate_arg, deprecated_args, add_full_name, remove_last_args
)

-from tests.aspects import unittest, DeprecationTestCase
+from tests.aspects import DeprecationTestCase


@add_full_name
diff --git a/tests/disambredir_tests.py b/tests/disambredir_tests.py
index 1726b28..4380abd 100644
--- a/tests/disambredir_tests.py
+++ b/tests/disambredir_tests.py
@@ -5,17 +5,18 @@
These tests write to the wiki.
"""
#
-# (C) Pywikibot team, 2015-2020
+# (C) Pywikibot team, 2015-2021
#
# Distributed under the terms of the MIT license.
#
+import unittest
+
from contextlib import suppress

import pywikibot

from scripts import disambredir

-from tests.aspects import unittest
from tests.bot_tests import FakeSaveBotTestCase, TWNBotTestCase
from tests.utils import fixed_generator

diff --git a/tests/djvu_tests.py b/tests/djvu_tests.py
index 4ce9d55..2d5f583 100644
--- a/tests/djvu_tests.py
+++ b/tests/djvu_tests.py
@@ -3,19 +3,20 @@
"""Unit tests for djvu.py."""

#
-# (C) Pywikibot team, 2015-2020
+# (C) Pywikibot team, 2015-2021
#
# Distributed under the terms of the MIT license.
#
import os
import subprocess
+import unittest

from contextlib import suppress

from pywikibot.tools.djvu import DjVuFile

from tests import join_data_path, create_path_func
-from tests.aspects import unittest, TestCase
+from tests.aspects import TestCase

join_djvu_data_path = create_path_func(join_data_path, 'djvu')

diff --git a/tests/dry_site_tests.py b/tests/dry_site_tests.py
index 2a71321..237d7cb 100644
--- a/tests/dry_site_tests.py
+++ b/tests/dry_site_tests.py
@@ -1,15 +1,17 @@
# -*- coding: utf-8 -*-
"""Tests against a fake Site object."""
#
-# (C) Pywikibot team, 2012-2020
+# (C) Pywikibot team, 2012-2021
#
# Distributed under the terms of the MIT license.
#
+import unittest
+
import pywikibot

from pywikibot.comms.http import user_agent

-from tests.aspects import unittest, DefaultDrySiteTestCase
+from tests.aspects import DefaultDrySiteTestCase


class TestDrySite(DefaultDrySiteTestCase):
diff --git a/tests/echo_tests.py b/tests/echo_tests.py
index ce64d4e..2a4c1a7 100644
--- a/tests/echo_tests.py
+++ b/tests/echo_tests.py
@@ -1,10 +1,12 @@
# -*- coding: utf-8 -*-
"""Test echo module."""
#
-# (C) Pywikibot team, 2019-2020
+# (C) Pywikibot team, 2019-2021
#
# Distributed under the terms of the MIT license.
#
+import unittest
+
from contextlib import suppress

import pywikibot
@@ -12,7 +14,7 @@
from pywikibot.echo import Notification
from pywikibot.tools import suppress_warnings

-from tests.aspects import unittest, DefaultDrySiteTestCase
+from tests.aspects import DefaultDrySiteTestCase


class TestNotification(DefaultDrySiteTestCase):
diff --git a/tests/edit_failure_tests.py b/tests/edit_failure_tests.py
index b82ddcf..93ce048 100644
--- a/tests/edit_failure_tests.py
+++ b/tests/edit_failure_tests.py
@@ -8,10 +8,12 @@
These tests use special code 'write = -1' for edit failures.
"""
#
-# (C) Pywikibot team, 2014-2020
+# (C) Pywikibot team, 2014-2021
#
# Distributed under the terms of the MIT license.
#
+import unittest
+
from contextlib import suppress

import pywikibot
@@ -28,7 +30,7 @@
)

from tests import patch
-from tests.aspects import unittest, TestCase, WikibaseTestCase
+from tests.aspects import TestCase, WikibaseTestCase


class TestSaveFailure(TestCase):
diff --git a/tests/edit_tests.py b/tests/edit_tests.py
index f480ec6..f6705b6 100644
--- a/tests/edit_tests.py
+++ b/tests/edit_tests.py
@@ -1,11 +1,12 @@
# -*- coding: utf-8 -*-
"""Tests for editing pages."""
#
-# (C) Pywikibot team, 2015-2020
+# (C) Pywikibot team, 2015-2021
#
# Distributed under the terms of the MIT license.
#
import time
+import unittest

from contextlib import suppress

@@ -14,7 +15,7 @@
from pywikibot import config
from pywikibot import page_put_queue

-from tests.aspects import unittest, TestCase
+from tests.aspects import TestCase
from tests.oauth_tests import OAuthSiteTestCase

called_back = False
diff --git a/tests/eventstreams_tests.py b/tests/eventstreams_tests.py
index d69225d..69dc638 100644
--- a/tests/eventstreams_tests.py
+++ b/tests/eventstreams_tests.py
@@ -1,11 +1,12 @@
# -*- coding: utf-8 -*-
"""Tests for the eventstreams module."""
#
-# (C) Pywikibot team, 2017-2020
+# (C) Pywikibot team, 2017-2021
#
# Distributed under the terms of the MIT license.
#
import json
+import unittest

from contextlib import suppress

@@ -15,7 +16,7 @@
from pywikibot import config
from pywikibot.family import WikimediaFamily

-from tests.aspects import unittest, TestCase, DefaultSiteTestCase
+from tests.aspects import TestCase, DefaultSiteTestCase


@mock.patch('pywikibot.comms.eventstreams.EventSource', new=mock.MagicMock())
diff --git a/tests/fixes_tests.py b/tests/fixes_tests.py
index 11a66cd..4fdef4b 100644
--- a/tests/fixes_tests.py
+++ b/tests/fixes_tests.py
@@ -1,16 +1,18 @@
# -*- coding: utf-8 -*-
"""Tests for fixes module."""
#
-# (C) Pywikibot team, 2015-2020
+# (C) Pywikibot team, 2015-2021
#
# Distributed under the terms of the MIT license.
#
+import unittest
+
from contextlib import suppress

from pywikibot import fixes

-from tests import unittest, join_data_path
from tests.aspects import TestCase
+from tests import join_data_path


class TestFixes(TestCase):
diff --git a/tests/flow_edit_tests.py b/tests/flow_edit_tests.py
index 43e62d9..0e1deaf 100644
--- a/tests/flow_edit_tests.py
+++ b/tests/flow_edit_tests.py
@@ -1,17 +1,18 @@
# -*- coding: utf-8 -*-
"""Edit tests for the flow module."""
#
-# (C) Pywikibot team, 2015-2020
+# (C) Pywikibot team, 2015-2021
#
# Distributed under the terms of the MIT license.
#
+import unittest
+
from contextlib import contextmanager, suppress

from pywikibot.exceptions import LockedPage
from pywikibot.flow import Board, Topic, Post

from tests.aspects import TestCase
-from tests import unittest


MODERATION_REASON = 'Pywikibot test'
diff --git a/tests/flow_tests.py b/tests/flow_tests.py
index 49995c7..93dd0c6 100644
--- a/tests/flow_tests.py
+++ b/tests/flow_tests.py
@@ -1,17 +1,17 @@
# -*- coding: utf-8 -*-
"""Tests for the flow module."""
#
-# (C) Pywikibot team, 2015-2020
+# (C) Pywikibot team, 2015-2021
#
# Distributed under the terms of the MIT license.
#
+import unittest
+
from contextlib import suppress

from pywikibot.exceptions import NoPage
from pywikibot.flow import Board, Topic, Post

-from tests import unittest
-
from tests.aspects import TestCase
from tests.basepage import (
BasePageMethodsTestBase,
diff --git a/tests/flow_thanks_tests.py b/tests/flow_thanks_tests.py
index 34f8ba2..568f3da 100644
--- a/tests/flow_thanks_tests.py
+++ b/tests/flow_thanks_tests.py
@@ -1,14 +1,15 @@
# -*- coding: utf-8 -*-
"""Tests for thanks-related code."""
#
-# (C) Pywikibot team, 2016-2020
+# (C) Pywikibot team, 2016-2021
#
# Distributed under the terms of the MIT license.
#
+import unittest
+
from pywikibot.flow import Topic

from tests.aspects import TestCase
-from tests import unittest


NO_THANKABLE_POSTS = 'There is no recent post which can be test thanked.'
diff --git a/tests/redirect_bot_tests.py b/tests/redirect_bot_tests.py
index dea9aa5..92bbcc7 100644
--- a/tests/redirect_bot_tests.py
+++ b/tests/redirect_bot_tests.py
@@ -1,10 +1,12 @@
# -*- coding: utf-8 -*-
"""Tests for the redirect.py script."""
#
-# (C) Pywikibot team, 2017-2020
+# (C) Pywikibot team, 2017-2021
#
# Distributed under the terms of the MIT license.
#
+import unittest
+
from contextlib import suppress

import pywikibot
@@ -12,7 +14,7 @@

from scripts.redirect import RedirectRobot

-from tests import Mock, patch, unittest
+from tests import Mock, patch
from tests.aspects import DefaultSiteTestCase


diff --git a/tests/reflinks_tests.py b/tests/reflinks_tests.py
index 7a0d260..7fe2d26 100644
--- a/tests/reflinks_tests.py
+++ b/tests/reflinks_tests.py
@@ -1,14 +1,16 @@
# -*- coding: utf-8 -*-
"""Tests for reflinks script."""
#
-# (C) Pywikibot team, 2014-2020
+# (C) Pywikibot team, 2014-2021
#
# Distributed under the terms of the MIT license.
#
+import unittest
+
from scripts.reflinks import XmlDumpPageGenerator, ReferencesRobot, main

from tests import join_xml_data_path
-from tests.aspects import unittest, TestCase, ScriptMainTestCase
+from tests.aspects import TestCase, ScriptMainTestCase
from tests.utils import empty_sites


diff --git a/tests/replacebot_tests.py b/tests/replacebot_tests.py
index 0d5fe82..b604250 100644
--- a/tests/replacebot_tests.py
+++ b/tests/replacebot_tests.py
@@ -1,10 +1,12 @@
# -*- coding: utf-8 -*-
"""Tests for the replace script and ReplaceRobot class."""
#
-# (C) Pywikibot team, 2015-2020
+# (C) Pywikibot team, 2015-2021
#
# Distributed under the terms of the MIT license.
#
+import unittest
+
from contextlib import suppress

import pywikibot
@@ -15,7 +17,6 @@

from tests import join_data_path

-from tests.aspects import unittest
from tests.bot_tests import TWNBotTestCase
from tests.utils import empty_sites

diff --git a/tests/script_tests.py b/tests/script_tests.py
index a368e39..ca5b53a 100644
--- a/tests/script_tests.py
+++ b/tests/script_tests.py
@@ -1,19 +1,20 @@
# -*- coding: utf-8 -*-
"""Test that each script can be compiled and executed."""
#
-# (C) Pywikibot team, 2014-2020
+# (C) Pywikibot team, 2014-2021
#
# Distributed under the terms of the MIT license.
#
import os
import sys
+import unittest

from contextlib import suppress

from pywikibot.tools import has_module

from tests import join_root_path, unittest_print
-from tests.aspects import (unittest, DefaultSiteTestCase, MetaTestCaseClass,
+from tests.aspects import (DefaultSiteTestCase, MetaTestCaseClass,
PwbTestCase)
from tests.utils import execute_pwb

diff --git a/tests/site_decorators_tests.py b/tests/site_decorators_tests.py
index 5962145..72b6e3b 100644
--- a/tests/site_decorators_tests.py
+++ b/tests/site_decorators_tests.py
@@ -1,15 +1,17 @@
# -*- coding: utf-8 -*-
"""Tests against a fake Site object."""
#
-# (C) Pywikibot team, 2012-2020
+# (C) Pywikibot team, 2012-2021
#
# Distributed under the terms of the MIT license.
#
+import unittest
+
from pywikibot.tools import deprecated
from pywikibot.site._decorators import must_be, need_right, need_version
from pywikibot.exceptions import UserRightsError

-from tests.aspects import unittest, DebugOnlyTestCase, DeprecationTestCase
+from tests.aspects import DebugOnlyTestCase, DeprecationTestCase


class TestMustBe(DebugOnlyTestCase):
diff --git a/tests/site_detect_tests.py b/tests/site_detect_tests.py
index 36f608d..2b8c79b 100644
--- a/tests/site_detect_tests.py
+++ b/tests/site_detect_tests.py
@@ -1,10 +1,12 @@
# -*- coding: utf-8 -*-
"""Test for site detection."""
#
-# (C) Pywikibot team, 2014-2020
+# (C) Pywikibot team, 2014-2021
#
# Distributed under the terms of the MIT license.
#
+import unittest
+
from contextlib import suppress
from urllib.parse import urlparse

@@ -16,7 +18,7 @@
from pywikibot.site_detect import MWSite

from tests import unittest_print
-from tests.aspects import unittest, TestCase, PatchingTestCase
+from tests.aspects import TestCase, PatchingTestCase
from tests.utils import DrySite


diff --git a/tests/siteinfo_tests.py b/tests/siteinfo_tests.py
index 6716f0a..289475a 100644
--- a/tests/siteinfo_tests.py
+++ b/tests/siteinfo_tests.py
@@ -1,11 +1,12 @@
# -*- coding: utf-8 -*-
"""Tests for the site module."""
#
-# (C) Pywikibot team, 2008-2020
+# (C) Pywikibot team, 2008-2021
#
# Distributed under the terms of the MIT license.
#
import re
+import unittest

from contextlib import suppress
from datetime import datetime
@@ -16,7 +17,7 @@

from tests import patch, MagicMock
from tests.aspects import (
- unittest, DefaultSiteTestCase, DefaultDrySiteTestCase,
+ DefaultSiteTestCase, DefaultDrySiteTestCase,
)
from tests.utils import entered_loop

diff --git a/tests/sparql_tests.py b/tests/sparql_tests.py
index df65a8c..9060486 100644
--- a/tests/sparql_tests.py
+++ b/tests/sparql_tests.py
@@ -1,15 +1,17 @@
# -*- coding: utf-8 -*-
"""Test cases for the SPARQL API."""
#
-# (C) Pywikibot team, 2016-2020
+# (C) Pywikibot team, 2016-2021
#
# Distributed under the terms of the MIT license.
#
+import unittest
+
from contextlib import suppress

import pywikibot.data.sparql as sparql

-from tests.aspects import unittest, TestCase, WikidataTestCase
+from tests.aspects import TestCase, WikidataTestCase
from tests import patch


diff --git a/tests/template_bot_tests.py b/tests/template_bot_tests.py
index 10a0f0f..87a3a79 100644
--- a/tests/template_bot_tests.py
+++ b/tests/template_bot_tests.py
@@ -1,17 +1,19 @@
# -*- coding: utf-8 -*-
"""Test template bot module."""
#
-# (C) Pywikibot team, 2015-2020
+# (C) Pywikibot team, 2015-2021
#
# Distributed under the terms of the MIT license.
#
+import unittest
+
import pywikibot

from pywikibot.pagegenerators import XMLDumpPageGenerator
from pywikibot.textlib import _MultiTemplateMatchBuilder

+from tests.aspects import TestCase
from tests import join_xml_data_path
-from tests.aspects import unittest, TestCase


class TestXMLPageGenerator(TestCase):
diff --git a/tests/tests_tests.py b/tests/tests_tests.py
index 83d7056..ecdd6d2 100755
--- a/tests/tests_tests.py
+++ b/tests/tests_tests.py
@@ -2,12 +2,14 @@
# -*- coding: utf-8 -*-
"""Tests for the tests package."""
#
-# (C) Pywikibot team, 2014-2020
+# (C) Pywikibot team, 2014-2021
#
# Distributed under the terms of the MIT license.
+import unittest
+
from contextlib import suppress

-from tests.aspects import unittest, TestCase
+from tests.aspects import TestCase


class HttpServerProblemTestCase(TestCase):
diff --git a/tests/textlib_tests.py b/tests/textlib_tests.py
index 3129c78..767ed1b 100644
--- a/tests/textlib_tests.py
+++ b/tests/textlib_tests.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Test textlib module."""
#
-# (C) Pywikibot team, 2011-2020
+# (C) Pywikibot team, 2011-2021
#
# Distributed under the terms of the MIT license.
#
@@ -9,6 +9,7 @@
import functools
import os
import re
+import unittest

from collections import OrderedDict
from contextlib import suppress
@@ -21,7 +22,7 @@
from pywikibot import UnknownSite

from tests.aspects import (
- unittest, require_modules, TestCase, DefaultDrySiteTestCase,
+ require_modules, TestCase, DefaultDrySiteTestCase,
PatchingTestCase, SiteAttributeTestCase,
)
from tests import mock
diff --git a/tests/thanks_tests.py b/tests/thanks_tests.py
index 5c10243..8665228 100644
--- a/tests/thanks_tests.py
+++ b/tests/thanks_tests.py
@@ -1,16 +1,17 @@
# -*- coding: utf-8 -*-
"""Tests for thanks-related code."""
#
-# (C) Pywikibot team, 2016-2020
+# (C) Pywikibot team, 2016-2021
#
# Distributed under the terms of the MIT license.
#
+import unittest
+
from contextlib import suppress

from pywikibot.page import Page, User

from tests.aspects import TestCase
-from tests import unittest


NO_THANKABLE_REVS = 'There is no recent change which can be test thanked.'
diff --git a/tests/thread_tests.py b/tests/thread_tests.py
index 1516b0e..49c7d31 100644
--- a/tests/thread_tests.py
+++ b/tests/thread_tests.py
@@ -1,14 +1,16 @@
# -*- coding: utf-8 -*-
"""Tests for threading tools."""
#
-# (C) Pywikibot team, 2014-2020
+# (C) Pywikibot team, 2014-2021
#
# Distributed under the terms of the MIT license.
#
+import unittest
+
from collections import Counter
from contextlib import suppress

-from tests.aspects import unittest, TestCase
+from tests.aspects import TestCase

from pywikibot.tools import ThreadedGenerator, intersect_generators


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

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ie5605483f2e8bf3c8e8f407f67f5ea9b7a4b069c
Gerrit-Change-Number: 656609
Gerrit-PatchSet: 3
Gerrit-Owner: Homeboy 445 <akshitsan13@gmail.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: Zoranzoki21 <zorandori4444@gmail.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged