Skip to content

Commit ef2ad8f

Browse files
authored
{Pylint} Fix useless-object-inheritance (#30331)
1 parent dc3ba8c commit ef2ad8f

File tree

42 files changed

+83
-83
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+83
-83
lines changed

scripts/ci/automation_full_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ def save_pipeline_result(pipeline_result):
496496
logger.info(f"save pipeline result to file: {filename}")
497497

498498

499-
class AutomaticScheduling(object):
499+
class AutomaticScheduling:
500500

501501
def __init__(self):
502502
"""

src/azure-cli-core/azure/cli/core/command_recommender.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def get_error_type(error_msg):
8383
return error_type.value
8484

8585

86-
class CommandRecommender(): # pylint: disable=too-few-public-methods
86+
class CommandRecommender: # pylint: disable=too-few-public-methods
8787
"""Recommend a command for user when user's command fails.
8888
It combines Aladdin recommendations and examples in help files."""
8989

src/azure-cli-core/azure/cli/core/extension/tests/latest/test_index_get.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
ERR_UNABLE_TO_GET_EXTENSIONS)
1313

1414

15-
class MockResponse(object):
15+
class MockResponse:
1616
def __init__(self, status_code, data):
1717
self.status_code = status_code
1818
self.data = data

src/azure-cli-core/azure/cli/core/tests/test_generic_update.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@
1515
from knack.util import CLIError
1616

1717

18-
class ListTestObject(object):
18+
class ListTestObject:
1919

2020
def __init__(self, val):
2121
self.list_value = list(val)
2222

2323

24-
class DictTestObject(object):
24+
class DictTestObject:
2525

2626
def __init__(self, val):
2727
self.dict_value = dict(val)
2828

2929

30-
class ObjectTestObject(object):
30+
class ObjectTestObject:
3131

3232
def __init__(self, str_val, int_val, bool_val):
3333
self.my_string = str(str_val)

src/azure-cli-core/azure/cli/core/tests/test_help_loaders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def dummy_handler(arg1, arg2=None, arg3=None, arg4=None):
5252
# region Test Help Loader
5353

5454

55-
class JsonLoaderMixin(object):
55+
class JsonLoaderMixin:
5656
"""A class containing helper methods for Json Loaders."""
5757

5858
# get the list of json help file names for the command or group

src/azure-cli-core/azure/cli/core/tests/test_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ def mock_add_extension(*args, **kwargs):
274274
self.assertIn("Extension another-ext-name installed. Please rerun your command.", logger_msgs[6])
275275

276276

277-
class VerifyError(object): # pylint: disable=too-few-public-methods
277+
class VerifyError: # pylint: disable=too-few-public-methods
278278

279279
def __init__(self, test, substr=None):
280280
self.test = test

src/azure-cli-core/azure/cli/core/tests/test_profile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,7 +1493,7 @@ def test_get_auth_info_for_newly_created_service_principal(self):
14931493
self.assertEqual('very_secret', extended_info['clientSecret'])
14941494

14951495

1496-
class FileHandleStub(object): # pylint: disable=too-few-public-methods
1496+
class FileHandleStub: # pylint: disable=too-few-public-methods
14971497

14981498
def write(self, content):
14991499
pass
@@ -1538,7 +1538,7 @@ def __init__(self, tenant_id): # pylint: disable=redefined-builtin
15381538
self.tenant_id = tenant_id
15391539

15401540

1541-
class TenantStub(object): # pylint: disable=too-few-public-methods
1541+
class TenantStub: # pylint: disable=too-few-public-methods
15421542

15431543
def __init__(self, tenant_id, display_name=MOCK_TENANT_DISPLAY_NAME, default_domain=MOCK_TENANT_DEFAULT_DOMAIN):
15441544
self.tenant_id = tenant_id

src/azure-cli-testsdk/azure/cli/testsdk/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
COVERAGE_FILE = 'az_command_coverage.txt'
3535

3636

37-
class CheckerMixin(object):
37+
class CheckerMixin:
3838

3939
def _apply_kwargs(self, val):
4040
try:
@@ -235,7 +235,7 @@ def get_subscription_id(self):
235235
return self.cmd('account list --query "[?isDefault].id" -o tsv').output.strip()
236236

237237

238-
class ExecutionResult(object):
238+
class ExecutionResult:
239239
def __init__(self, cli_ctx, command, expect_failure=False):
240240
self.output = ''
241241
self.applog = ''

src/azure-cli-testsdk/azure/cli/testsdk/checkers.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from .exceptions import JMESPathCheckAssertionError
1010

1111

12-
class JMESPathCheck(object): # pylint: disable=too-few-public-methods
12+
class JMESPathCheck: # pylint: disable=too-few-public-methods
1313
def __init__(self, query, expected_result, case_sensitive=True):
1414
self._query = query
1515
self._expected_result = expected_result
@@ -37,7 +37,7 @@ def __call__(self, execution_result):
3737
execution_result.output)
3838

3939

40-
class JMESPathCheckExists(object): # pylint: disable=too-few-public-methods
40+
class JMESPathCheckExists: # pylint: disable=too-few-public-methods
4141
def __init__(self, query):
4242
self._query = query
4343

@@ -50,7 +50,7 @@ def __call__(self, execution_result):
5050
execution_result.output)
5151

5252

53-
class JMESPathCheckNotExists(object): # pylint: disable=too-few-public-methods
53+
class JMESPathCheckNotExists: # pylint: disable=too-few-public-methods
5454
def __init__(self, query):
5555
self._query = query
5656

@@ -63,7 +63,7 @@ def __call__(self, execution_result):
6363
execution_result.output)
6464

6565

66-
class JMESPathCheckGreaterThan(object): # pylint: disable=too-few-public-methods
66+
class JMESPathCheckGreaterThan: # pylint: disable=too-few-public-methods
6767
def __init__(self, query, expected_result):
6868
self._query = query
6969
self._expected_result = expected_result
@@ -82,7 +82,7 @@ def __call__(self, execution_result):
8282
execution_result.output)
8383

8484

85-
class JMESPathPatternCheck(object): # pylint: disable=too-few-public-methods
85+
class JMESPathPatternCheck: # pylint: disable=too-few-public-methods
8686
def __init__(self, query, expected_result):
8787
self._query = query
8888
self._expected_result = expected_result
@@ -96,7 +96,7 @@ def __call__(self, execution_result):
9696
execution_result.output)
9797

9898

99-
class NoneCheck(object): # pylint: disable=too-few-public-methods
99+
class NoneCheck: # pylint: disable=too-few-public-methods
100100
def __call__(self, execution_result): # pylint: disable=no-self-use
101101
none_strings = ['[]', '{}', 'false']
102102
try:
@@ -107,7 +107,7 @@ def __call__(self, execution_result): # pylint: disable=no-self-use
107107
"string in {}".format(data, none_strings))
108108

109109

110-
class StringCheck(object): # pylint: disable=too-few-public-methods
110+
class StringCheck: # pylint: disable=too-few-public-methods
111111
def __init__(self, expected_result):
112112
self.expected_result = expected_result
113113

@@ -120,7 +120,7 @@ def __call__(self, execution_result):
120120
"Actual value '{}' != Expected value {}".format(result, self.expected_result))
121121

122122

123-
class StringContainCheck(object): # pylint: disable=too-few-public-methods
123+
class StringContainCheck: # pylint: disable=too-few-public-methods
124124
def __init__(self, expected_result):
125125
self.expected_result = expected_result
126126

@@ -134,7 +134,7 @@ def __call__(self, execution_result):
134134
self.expected_result))
135135

136136

137-
class StringContainCheckIgnoreCase(object): # pylint: disable=too-few-public-methods
137+
class StringContainCheckIgnoreCase: # pylint: disable=too-few-public-methods
138138
def __init__(self, expected_result):
139139
self.expected_result = expected_result.lower()
140140

src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from .const import ENV_LIVE_TEST
99

1010

11-
class TestConfig(object): # pylint: disable=too-few-public-methods
11+
class TestConfig: # pylint: disable=too-few-public-methods
1212
def __init__(self, parent_parsers=None, config_file=None):
1313
parent_parsers = parent_parsers or []
1414
self.parser = configargparse.ArgumentParser(parents=parent_parsers)

0 commit comments

Comments
 (0)