We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c0c232e commit 9af7548Copy full SHA for 9af7548
tests/test_doc_example.py
@@ -0,0 +1,17 @@
1
+from importlib.machinery import SourceFileLoader
2
+from pathlib import Path
3
+
4
+THIS_DIR = Path(__file__).parent
5
6
7
+async def test_run_job_burst(redis_conn, loop, caplog):
8
+ demo = SourceFileLoader('demo', str(THIS_DIR / '../docs/demo.py')).load_module()
9
+ worker = demo.Worker(burst=True, loop=loop)
10
11
+ downloader = demo.Downloader(loop=loop)
12
13
+ await downloader.download_content('http://example.com')
14
+ await worker.run()
15
+ await downloader.close()
16
+ assert 's → Downloader.download_content(http://example.com)' in caplog
17
+ assert 's ← Downloader.download_content ● 1' in caplog
0 commit comments