jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/688282 )
Change subject: [W0107] Remove unnecessary pass statement ......................................................................
[W0107] Remove unnecessary pass statement
Change-Id: I785b6475f5d8c7e54887f72fa38eb7c3cf7ebbd4 --- M pywikibot/bot.py M pywikibot/bot_choice.py M pywikibot/config.py M pywikibot/exceptions.py M pywikibot/logentries.py M pywikibot/login.py M pywikibot/tools/__init__.py M pywikibot/userinterfaces/terminal_interface_base.py M tests/aspects.py M tests/deprecation_tests.py M tests/generate_family_file_tests.py M tests/i18n_tests.py M tests/logentries_tests.py M tests/oauth_tests.py M tests/replacebot_tests.py M tests/ui_tests.py M tests/utils.py M tests/wikibase_tests.py 18 files changed, 5 insertions(+), 88 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/bot.py b/pywikibot/bot.py index 7aaa8f8..3d6a7e2 100644 --- a/pywikibot/bot.py +++ b/pywikibot/bot.py @@ -1475,11 +1475,9 @@ operation which is more than just initialize the instance. Invoked by run() before running through generator loop. """ - pass
def teardown(self): """Some cleanups after run operation. Invoked by exit().""" - pass
def run(self): """Process all pages in generator. diff --git a/pywikibot/bot_choice.py b/pywikibot/bot_choice.py index 8f91f76..b043c1d 100755 --- a/pywikibot/bot_choice.py +++ b/pywikibot/bot_choice.py @@ -487,8 +487,6 @@
"""An option to show a list and select multiple items."""
- pass -
class HighlightContextOption(ContextOption):
diff --git a/pywikibot/config.py b/pywikibot/config.py index 82e12c7..2c5f752 100644 --- a/pywikibot/config.py +++ b/pywikibot/config.py @@ -89,8 +89,6 @@
"""Feature that is no longer supported."""
- pass -
# IMPORTANT: # Do not change any of the variables in this file. Instead, make diff --git a/pywikibot/exceptions.py b/pywikibot/exceptions.py index 990a8c4..c9052f7 100644 --- a/pywikibot/exceptions.py +++ b/pywikibot/exceptions.py @@ -176,22 +176,16 @@
"""Feature that is no longer implemented."""
- pass -
class ArgumentDeprecationWarning(UserWarning, FutureWarning):
"""Command line argument that is no longer supported."""
- pass -
class FamilyMaintenanceWarning(UserWarning):
"""Family class is missing definitions."""
- pass -
class Error(Exception):
@@ -348,8 +342,6 @@
"""Username is not in user-config.py."""
- pass -
class NoPageError(PageRelatedError):
@@ -400,29 +392,21 @@
"""Site does not exist."""
- pass -
class UnknownSiteError(SiteDefinitionError):
"""Site does not exist in Family."""
- pass -
class UnknownFamilyError(SiteDefinitionError):
"""Family is not registered."""
- pass -
class UnknownExtensionError(Error, NotImplementedError):
"""Extension is not defined."""
- pass -
class VersionParseError(Error):
@@ -491,8 +475,6 @@
"""Invalid page title."""
- pass -
class LockedPageError(PageSaveRelatedError):
@@ -596,36 +578,26 @@
"""Got unexpected server response."""
- pass -
class FatalServerError(ServerError):
"""A fatal server error will not be corrected by resending the request."""
- pass -
class Server504Error(ServerError):
"""Server timed out with HTTP 504 code."""
- pass -
class Server414Error(ServerError):
"""Server returned with HTTP 414 code."""
- pass -
class CaptchaError(Error):
"""Captcha is asked and config.solve_captcha == False."""
- pass -
class AutoblockUserError(Error):
@@ -636,8 +608,6 @@ for him (i.e. roughly everything except unblock). """
- pass -
class UnhandledAnswerError(Error):
@@ -650,28 +620,23 @@
class TranslationError(Error, ImportError):
- """Raised when no correct translation could be found.""" + """Raised when no correct translation could be found.
- # Inherits from ImportError, as this exception is now used - # where previously an ImportError would have been raised, - # and may have been caught by scripts as such. - - pass + Inherits from ImportError, as this exception is now used + where previously an ImportError would have been raised, + and may have been caught by scripts as such. + """
class UserRightsError(Error):
"""Insufficient user rights to perform an action."""
- pass -
class HiddenKeyError(UserRightsError, KeyError):
"""Insufficient user rights to view the hidden key."""
- pass -
class NotEmailableError(PageRelatedError):
@@ -689,8 +654,6 @@
"""Wikibase related error."""
- pass -
class NoWikibaseEntityError(WikiBaseError):
@@ -712,29 +675,21 @@
"""This globe is not implemented yet in either WikiBase or pywikibot."""
- pass -
class EntityTypeUnknownError(WikiBaseError):
"""The requested entity type is not recognised on this site."""
- pass -
class TimeoutError(Error):
"""Request failed with a timeout error."""
- pass -
class MaxlagTimeoutError(TimeoutError):
"""Request failed with a maxlag timeout error."""
- pass -
DEPRECATED_EXCEPTIONS = { 'NoUsername': 'NoUsernameError', diff --git a/pywikibot/logentries.py b/pywikibot/logentries.py index 2c58829..106448d 100644 --- a/pywikibot/logentries.py +++ b/pywikibot/logentries.py @@ -135,8 +135,6 @@
"""A log entry class for unspecified log events."""
- pass -
class UserTargetLogEntry(LogEntry):
diff --git a/pywikibot/login.py b/pywikibot/login.py index 4ec3893..a74042c 100644 --- a/pywikibot/login.py +++ b/pywikibot/login.py @@ -36,8 +36,6 @@
"""The format of password file is incorrect."""
- pass -
_logger = 'wiki.login'
diff --git a/pywikibot/tools/__init__.py b/pywikibot/tools/__init__.py index 733a656..dd5df46 100644 --- a/pywikibot/tools/__init__.py +++ b/pywikibot/tools/__init__.py @@ -61,8 +61,6 @@
"""Feature that is no longer implemented."""
- pass -
def is_IP(IP: str) -> bool: # noqa N802, N803 """Verify the IP address provided is valid. @@ -1049,15 +1047,11 @@
"""Dict with SelfCallMixin."""
- pass -
class SelfCallString(SelfCallMixin, str):
"""String with SelfCallMixin."""
- pass -
class DequeGenerator(Iterator, collections.deque):
diff --git a/pywikibot/userinterfaces/terminal_interface_base.py b/pywikibot/userinterfaces/terminal_interface_base.py index 6dc7c2a..dfbb0ac 100755 --- a/pywikibot/userinterfaces/terminal_interface_base.py +++ b/pywikibot/userinterfaces/terminal_interface_base.py @@ -502,8 +502,6 @@
"""Terminal logging formatter."""
- pass -
class MaxLevelFilter(logging.Filter):
diff --git a/tests/aspects.py b/tests/aspects.py index c0e2e36..4ad3c4b 100644 --- a/tests/aspects.py +++ b/tests/aspects.py @@ -1031,7 +1031,6 @@
def after_assert(self, assertion, *args, **kwargs): """Handle after the assertion.""" - pass
def patch_assert(self, assertion): """Execute process_assert when the assertion is called.""" @@ -1283,8 +1282,6 @@
"""Run tests against any site connected to a Wikibase."""
- pass -
class WikidataTestCase(WikibaseTestCase):
diff --git a/tests/deprecation_tests.py b/tests/deprecation_tests.py index 80df7ca..8a010ed 100644 --- a/tests/deprecation_tests.py +++ b/tests/deprecation_tests.py @@ -40,19 +40,16 @@ @noop() def decorated_func(): """Test dummy decorator.""" - pass
@noop(foo='bar') def decorated_func2(): """Test dummy decorator.""" - pass
@noop('baz') def decorated_func3(): """Test dummy decorator.""" - pass
class DecoratorFullNameTestCase(DeprecationTestCase): @@ -247,8 +244,6 @@
"""Deprecated class."""
- pass -
@deprecated() class DeprecatedClass: diff --git a/tests/generate_family_file_tests.py b/tests/generate_family_file_tests.py index 8248aa6..f89341c 100644 --- a/tests/generate_family_file_tests.py +++ b/tests/generate_family_file_tests.py @@ -28,7 +28,6 @@
def writefile(self, verify): """Pass writing.""" - pass
class TestGenerateFamilyFiles(DefaultSiteTestCase): diff --git a/tests/i18n_tests.py b/tests/i18n_tests.py index f37dd06..e67e0d4 100644 --- a/tests/i18n_tests.py +++ b/tests/i18n_tests.py @@ -26,8 +26,6 @@
"""Nested class to hold the family name attribute."""
- pass - def __init__(self, code, family='wikipedia'): """Initializer.""" self.code = code diff --git a/tests/logentries_tests.py b/tests/logentries_tests.py index 1be0e70..f4d5653 100644 --- a/tests/logentries_tests.py +++ b/tests/logentries_tests.py @@ -162,8 +162,6 @@
"""Test general LogEntry properties."""
- pass -
class TestSimpleLogentries(TestLogentriesBase):
diff --git a/tests/oauth_tests.py b/tests/oauth_tests.py index e1c924e..e33821e 100644 --- a/tests/oauth_tests.py +++ b/tests/oauth_tests.py @@ -48,8 +48,6 @@
"""Default OAuth site test."""
- pass -
class TestOauthLoginManger(DefaultOAuthSiteTestCase):
diff --git a/tests/replacebot_tests.py b/tests/replacebot_tests.py index b73c9e0..e9ebb5b 100644 --- a/tests/replacebot_tests.py +++ b/tests/replacebot_tests.py @@ -54,7 +54,6 @@
def patched_login(): """Do nothing.""" - pass
def patched_site(*args, **kwargs): """Patching a Site instance replacing it's login.""" diff --git a/tests/ui_tests.py b/tests/ui_tests.py index 35e716c..762a0ee 100644 --- a/tests/ui_tests.py +++ b/tests/ui_tests.py @@ -136,8 +136,6 @@
"""pywikibot manager class."""
- pass - pywikibotManager.register('pywikibot', pywikibotWrapper) _manager = pywikibotManager( address=('127.0.0.1', 47228), diff --git a/tests/utils.py b/tests/utils.py index d140270..71f8bfe 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -434,7 +434,6 @@ @password.setter def password(self, value): """Ignore password changes.""" - pass
def execute(command, data_in=None, timeout=None, error=None): diff --git a/tests/wikibase_tests.py b/tests/wikibase_tests.py index a22e299..a8d9a16 100644 --- a/tests/wikibase_tests.py +++ b/tests/wikibase_tests.py @@ -851,7 +851,6 @@
"""Dummy ItemPage subclass."""
- pass page = pywikibot.Page(self.site, 'foo') self.assertIsInstance(MyItemPage.fromPage(page, lazy_load=True), MyItemPage)
pywikibot-commits@lists.wikimedia.org