MCPcopy
hub / github.com/scrapy/scrapy / check

Method check

tests/test_extension_periodic_log.py:105–112  ·  view source on GitHub ↗
(settings: dict[str, Any], condition: Callable)

Source from the content-addressed store, hash-verified

103 return ext, a, b
104
105 def check(settings: dict[str, Any], condition: Callable) -> None:
106 ext, a, b = emulate(settings)
107 assert list(a["delta"].keys()) == [
108 k for k, v in ext.stats._stats.items() if condition(k, v)
109 ]
110 assert list(b["delta"].keys()) == [
111 k for k, v in ext.stats._stats.items() if condition(k, v)
112 ]
113
114 # Including all
115 check({"PERIODIC_LOG_DELTA": True}, lambda k, v: isinstance(v, (int, float)))

Calls 2

keysMethod · 0.80
itemsMethod · 0.80

Tested by

no test coverage detected