@@ -0,0 +1,1084 @@
+from twisted.internet import defer%0Afrom twisted.trial import unittest%0A%0Afrom scrapy import signals, Request, Spider%0Afrom scrapy.utils.test import get_crawler%0A%0Afrom tests.mockserver import MockServer%0A%0A%0Aclass ItemSpider(Spider):%0A    name = 'itemspider'%0A%0A    def start_requests(self):%0A        for _ in range(10):%0A            yield Request(self.mockserver.url('/status?n=200'),%0A                          dont_filter=True)%0A%0A    def parse(self, response):%0A        return %7B'field': 42%7D%0A%0A%0Aclass AsyncSignalTestCase(unittest.TestCase):%0A    def setUp(self):%0A        self.mockserver = MockServer()%0A        self.mockserver.__enter__()%0A        self.items = %5B%5D%0A%0A    def tearDown(self):%0A        self.mockserver.__exit__(None, None, None)%0A%0A    async def _on_item_scraped(self, item):%0A        self.items.append(item)%0A%0A    @defer.inlineCallbacks%0A    def test_simple_pipeline(self):%0A        crawler = get_crawler(ItemSpider)%0A        crawler.signals.connect(self._on_item_scraped, signals.item_scraped)%0A        yield crawler.crawl(mockserver=self.mockserver)%0A        self.assertEqual(len(self.items), 10)%0A

Add a test for an async item_scraped handler.