Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@monitors.order(5)
def test_c(self):
pass
@monitors.order(3)
def test_a(self):
pass
class Unordered:
class A(DummyMonitor):
pass
class B(DummyMonitor):
pass
class C(DummyMonitorSuite):
pass
class D(DummyMonitorSuite):
pass
class Ordered:
@monitors.order(1)
class A(DummyMonitor):
pass
@monitors.order(2)
class B(DummyMonitor):
pass
@monitors.order(3)
class C(DummyMonitorSuite):
pass
@monitors.order(4)
class D(DummyMonitorSuite):
pass
@monitors.order(5)
def test_b(self):
pass
class B(DummyMonitor):
pass
class C(DummyMonitorSuite):
pass
class D(DummyMonitorSuite):
pass
class Ordered:
@monitors.order(1)
class A(DummyMonitor):
pass
@monitors.order(2)
class B(DummyMonitor):
pass
@monitors.order(3)
class C(DummyMonitorSuite):
pass
@monitors.order(4)
class D(DummyMonitorSuite):
pass
# ----------------------------------
# Methods ordering
# ----------------------------------
class UnorderedMethodsMonitor(Monitor):
@monitors.order(5)
def test_a(self):
pass
class Ordered:
@monitors.order(1)
class A(DummyMonitor):
pass
@monitors.order(2)
class B(DummyMonitor):
pass
@monitors.order(3)
class C(DummyMonitorSuite):
pass
@monitors.order(4)
class D(DummyMonitorSuite):
pass
# ----------------------------------
# Methods ordering
# ----------------------------------
class UnorderedMethodsMonitor(Monitor):
def test_a(self):
pass
def test_b(self):
pass
def test_c(self):
pass
'kafka/sources_sent': 29774,
'memusage/max': 269193216,
'memusage/startup': 55193600,
'request_depth_max': 1,
'response_received_count': 32931,
'scheduler/dequeued': 66817,
'scheduler/dequeued/disk': 63795,
'scheduler/dequeued/memory': 3022,
'scheduler/enqueued': 66817,
'scheduler/enqueued/disk': 63795,
'scheduler/enqueued/memory': 3022,
'start_time': datetime.datetime(2015, 4, 29, 10, 38, 49, 717771)
}
@monitors.order(3)
class SpiderMonitor(StatsMonitor):
"""Spider stats monitor"""
@monitors.name('Crawl duration')
@monitors.level.high
@monitors.order(1)
def test_crawl_duration(self):
"""Ensures that crawl hasn't take too long."""
pass
@monitors.name('Requests vs responses')
@monitors.order(2)
def test_crawl_requests_vs_responses(self):
"""Checks that most of the requests have a response."""
pass
@monitors.order(3)
def test_finish_reason(self):
"""Ensures that the spider has finished correctly."""
pass