jenkins-bot has submitted this change and it was merged.
Change subject: Remove old test class names ......................................................................
Remove old test class names
Change-Id: I944cc0b0a0862a6f1b479e57a5c44ff6a0f72acd --- M tests/aspects.py M tests/utils.py 2 files changed, 7 insertions(+), 14 deletions(-)
Approvals: John Vandenberg: Looks good to me, but someone else must approve XZise: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/aspects.py b/tests/aspects.py index 2458b6b..7120fde 100644 --- a/tests/aspects.py +++ b/tests/aspects.py @@ -36,6 +36,9 @@ import time import warnings
+if sys.version_info[0] > 2: + import six + import pywikibot
from pywikibot import config, log, ServerError, Site @@ -45,7 +48,9 @@ from pywikibot.data.api import Request as _original_Request
import tests + from tests import unittest, patch_request, unpatch_request +from tests.utils import execute_pwb, DrySite, DryRequest
class TestCaseBase(unittest.TestCase): @@ -395,8 +400,7 @@ # as the default, to show a useful error message. config.site_interface = SiteNotPermitted
- pywikibot.data.api.Request = tests.utils.DryRequest - from tests.utils import DrySite + pywikibot.data.api.Request = DryRequest self.old_convert = pywikibot.Claim.TARGET_CONVERTER['commonsMedia'] pywikibot.Claim.TARGET_CONVERTER['commonsMedia'] = ( lambda value, site: pywikibot.FilePage( @@ -820,8 +824,6 @@
interface = None # defaults to 'APISite' if hasattr(cls, 'dry') and cls.dry: - # Delay load to avoid cyclic import - from tests.utils import DrySite interface = DrySite
for data in cls.sites.values(): @@ -919,7 +921,6 @@
if sys.version_info[0] > 2: - import six TestCase = six.add_metaclass(MetaTestCaseClass)(TestCase)
@@ -1170,8 +1171,6 @@ os.environ[str('PYWIKIBOT2_DIR')] = self.orig_pywikibot_dir
def _execute(self, args, data_in=None, timeout=0, error=None): - from tests.utils import execute_pwb - site = self.get_site()
args = args + ['-family:' + site.family.name, diff --git a/tests/utils.py b/tests/utils.py index 99629e8..913b213 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -25,14 +25,8 @@ from pywikibot.data.api import CachedRequest from pywikibot.data.api import Request as _original_Request
-from tests import aspects, _pwb_py +from tests import _pwb_py from tests import unittest # noqa - -BaseTestCase = aspects.TestCase -NoSiteTestCase = aspects.TestCase -SiteTestCase = aspects.TestCase -CachedTestCase = aspects.TestCase -PywikibotTestCase = aspects.TestCase
class DrySiteNote(RuntimeWarning):
pywikibot-commits@lists.wikimedia.org