Skip to content

Commit 92268e1

Browse files
committed
ruff format with 0.10.0
1 parent 0baf893 commit 92268e1

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

Diff for: locust/contrib/fasthttp.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ def rest_(self, method, url, name=None, **kwargs) -> Generator[RestResponseConte
471471
separator = "&" if "?" in url else "?"
472472
if name is None:
473473
name = url + separator + "_=..."
474-
with self.rest(method, f"{url}{separator}_={int(time.time()*1000)}", name=name, **kwargs) as resp:
474+
with self.rest(method, f"{url}{separator}_={int(time.time() * 1000)}", name=name, **kwargs) as resp:
475475
yield resp
476476

477477

Diff for: locust/runners.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,9 @@ def spawn(user_class: str, spawn_count: int) -> list[User]:
209209
new_users: list[User] = []
210210
while n < spawn_count:
211211
new_user = self.user_classes_by_name[user_class](self.environment)
212-
assert hasattr(
213-
new_user, "environment"
214-
), f"Attribute 'environment' is missing on user {user_class}. Perhaps you defined your own __init__ and forgot to call the base constructor? (super().__init__(*args, **kwargs))"
212+
assert hasattr(new_user, "environment"), (
213+
f"Attribute 'environment' is missing on user {user_class}. Perhaps you defined your own __init__ and forgot to call the base constructor? (super().__init__(*args, **kwargs))"
214+
)
215215
new_user.start(self.user_greenlets)
216216
new_users.append(new_user)
217217
n += 1

Diff for: locust/stats.py

+4-7
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,7 @@ def get_stats_summary(stats: RequestStats, current=True) -> list[str]:
827827
("%-" + str(STATS_TYPE_WIDTH) + "s %-" + str(name_column_width) + "s %7s %12s |%7s %7s %7s%7s | %7s %11s")
828828
% ("Type", "Name", "# reqs", "# fails", "Avg", "Min", "Max", "Med", "req/s", "failures/s")
829829
)
830-
separator = f'{"-" * STATS_TYPE_WIDTH}|{"-" * (name_column_width)}|{"-" * 7}|{"-" * 13}|{"-" * 7}|{"-" * 7}|{"-" * 7}|{"-" * 7}|{"-" * 8}|{"-" * 11}'
830+
separator = f"{'-' * STATS_TYPE_WIDTH}|{'-' * (name_column_width)}|{'-' * 7}|{'-' * 13}|{'-' * 7}|{'-' * 7}|{'-' * 7}|{'-' * 7}|{'-' * 8}|{'-' * 11}"
831831
summary.append(separator)
832832
for key in sorted(stats.entries.keys()):
833833
r = stats.entries[key]
@@ -850,14 +850,11 @@ def get_percentile_stats_summary(stats: RequestStats) -> list[str]:
850850
summary = ["Response time percentiles (approximated)"]
851851
headers = ("Type", "Name") + tuple(get_readable_percentiles(PERCENTILES_TO_REPORT)) + ("# reqs",)
852852
summary.append(
853-
(
854-
f"%-{str(STATS_TYPE_WIDTH)}s %-{str(STATS_NAME_WIDTH)}s %8s "
855-
f"{' '.join(['%6s'] * len(PERCENTILES_TO_REPORT))}"
856-
)
853+
(f"%-{str(STATS_TYPE_WIDTH)}s %-{str(STATS_NAME_WIDTH)}s %8s {' '.join(['%6s'] * len(PERCENTILES_TO_REPORT))}")
857854
% headers
858855
)
859856
separator = (
860-
f'{"-" * STATS_TYPE_WIDTH}|{"-" * STATS_NAME_WIDTH}|{"-" * 8}|{("-" * 6 + "|") * len(PERCENTILES_TO_REPORT)}'
857+
f"{'-' * STATS_TYPE_WIDTH}|{'-' * STATS_NAME_WIDTH}|{'-' * 8}|{('-' * 6 + '|') * len(PERCENTILES_TO_REPORT)}"
861858
)[:-1]
862859
summary.append(separator)
863860
for key in sorted(stats.entries.keys()):
@@ -880,7 +877,7 @@ def print_error_report(stats: RequestStats) -> None:
880877
def get_error_report_summary(stats) -> list[str]:
881878
summary = ["Error report"]
882879
summary.append("%-18s %-100s" % ("# occurrences", "Error"))
883-
separator = f'{"-" * 18}|{"-" * ((80 + STATS_NAME_WIDTH) - 19)}'
880+
separator = f"{'-' * 18}|{'-' * ((80 + STATS_NAME_WIDTH) - 19)}"
884881
summary.append(separator)
885882
for error in stats.errors.values():
886883
summary.append("%-18i %-100s" % (error.occurrences, error.to_name()))

0 commit comments

Comments
 (0)