Skip to content

Commit 8958b0c

Browse files
committed
pylint refactoring
1 parent 1a70452 commit 8958b0c

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

tests/performance_sitespeed_io.py

+19-7
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,21 @@ def run_test(global_translation, lang_code, url):
8282
rating += mobile_rating
8383
result_dict.update(mobile_result_dict)
8484

85+
rating += rate_custom_result_dict(
86+
global_translation, result_dict, validator_result_dicts,
87+
desktop_result_dict, mobile_result_dict,
88+
desktop_rating, mobile_rating)
89+
90+
print(global_translation('TEXT_TEST_END').format(
91+
datetime.now().strftime('%Y-%m-%d %H:%M:%S')))
92+
93+
return (rating, result_dict)
94+
95+
def rate_custom_result_dict( # pylint: disable=too-many-arguments,too-many-locals
96+
global_translation, result_dict, validator_result_dicts,
97+
desktop_result_dict, mobile_result_dict,
98+
desktop_rating, mobile_rating):
99+
rating = Rating(global_translation)
85100
for validator_result_dict in validator_result_dicts:
86101
validator_name = validator_result_dict['name']
87102
reference_name = None
@@ -111,11 +126,7 @@ def run_test(global_translation, lang_code, url):
111126
rating.overall_review += (
112127
f'- [{reference_name}] Advice: Rating may improve from {reference_rating} to '
113128
f'{validator_rating_overall} with {validator_name} changes\r\n')
114-
115-
print(global_translation('TEXT_TEST_END').format(
116-
datetime.now().strftime('%Y-%m-%d %H:%M:%S')))
117-
118-
return (rating, result_dict)
129+
return rating
119130

120131

121132
def get_validators():
@@ -254,8 +265,9 @@ def validate_on_mobile(url):
254265
return result_dict
255266

256267

257-
def rate_result_dict(result_dict, reference_result_dict,
258-
mode, global_translation):
268+
def rate_result_dict( # pylint: disable=too-many-branches,too-many-locals
269+
result_dict, reference_result_dict,
270+
mode, global_translation):
259271
limit = 500
260272

261273
rating = Rating(global_translation)

0 commit comments

Comments
 (0)