Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

periodic_log: typing

Georgiy Zatserklianyie9b088f1fb43
diff --git a/tests/test_extension_periodic_log.py b/tests/test_extension_periodic_log.py
index 242e390b3..80f5c3177 100644
--- a/tests/test_extension_periodic_log.py
+++ b/tests/test_extension_periodic_log.py
@@ -1,4 +1,5 @@
import datetime
+import typing
import unittest
from scrapy.crawler import Crawler
@@ -96,7 +97,7 @@ class TestPeriodicLog(unittest.TestCase):
ext.spider_closed(spider, reason="finished")
return ext, a, b
- def check(settings: dict, condition: callable):
+ def check(settings: dict, condition: typing.Callable):
ext, a, b = emulate(settings)
assert list(a["delta"].keys()) == [
k for k, v in ext.stats._stats.items() if condition(k, v)
@@ -153,7 +154,7 @@ class TestPeriodicLog(unittest.TestCase):
ext.spider_closed(spider, reason="finished")
return ext, a, b
- def check(settings: dict, condition: callable):
+ def check(settings: dict, condition: typing.Callable):
ext, a, b = emulate(settings)
assert list(a["stats"].keys()) == [
k for k, v in ext.stats._stats.items() if condition(k, v)