-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6064 from wRAR/signals-proper
Refactor installing signals.
- Loading branch information
Showing
8 changed files
with
97 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from twisted.internet.defer import Deferred | ||
|
||
import scrapy | ||
from scrapy.crawler import CrawlerProcess | ||
from scrapy.utils.defer import maybe_deferred_to_future | ||
|
||
|
||
class SleepingSpider(scrapy.Spider): | ||
name = "sleeping" | ||
|
||
start_urls = ["data:,;"] | ||
|
||
async def parse(self, response): | ||
from twisted.internet import reactor | ||
|
||
d = Deferred() | ||
reactor.callLater(3, d.callback, None) | ||
await maybe_deferred_to_future(d) | ||
|
||
|
||
process = CrawlerProcess(settings={}) | ||
|
||
process.crawl(SleepingSpider) | ||
process.start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# Tests requirements | ||
attrs | ||
pexpect >= 4.8.0 | ||
pyftpdlib >= 1.5.8 | ||
pytest | ||
pytest-cov==4.0.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters