Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
shafiq-muhammad committed Aug 22, 2024
1 parent 53d1a89 commit ceef17a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions spidermon/contrib/scrapy/monitors/monitors.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,7 @@ class SPMErrorRatioMonitor(BaseScrapyMonitor):

stat_name = "zyte_smartproxy/response/error"

@monitors.name(
"The error ratio should be less than threshold"
)
@monitors.name("The error ratio should be less than threshold")
def test_maximum_error_ratio(self):
if self.stat_name not in self.stats:
message = f"Unable to find '{self.stat_name}' in job stats."
Expand All @@ -346,9 +344,11 @@ def test_maximum_error_ratio(self):

errors = self.stats[self.stat_name]
requests = self.stats["zyte_smartproxy/request"]
ratio = errors/requests
ratio = errors / requests

msg = "Too many failed SPM responses ({}) reached the maximum retry amount".format(errors)
msg = "Too many failed SPM responses ({}) reached the maximum retry amount".format(
errors
)
self.assertLessEqual(ratio, threshold, msg=msg)


Expand Down

0 comments on commit ceef17a

Please sign in to comment.