forked from LBRYCommunity/lbry-sdk
Try to suppress asyncio.CancelledError in a different way in test_streaming.py.
This commit is contained in:
parent
d0b5a0a8fd
commit
c2d2080034
1 changed files with 5 additions and 2 deletions
|
@ -3,6 +3,7 @@ import hashlib
|
||||||
import aiohttp
|
import aiohttp
|
||||||
import aiohttp.web
|
import aiohttp.web
|
||||||
import asyncio
|
import asyncio
|
||||||
|
import contextlib
|
||||||
|
|
||||||
from lbry.file.source import ManagedDownloadSource
|
from lbry.file.source import ManagedDownloadSource
|
||||||
from lbry.utils import aiohttp_request
|
from lbry.utils import aiohttp_request
|
||||||
|
@ -353,6 +354,7 @@ class RangeRequests(CommandTestCase):
|
||||||
path = stream.full_path
|
path = stream.full_path
|
||||||
self.assertIsNotNone(path)
|
self.assertIsNotNone(path)
|
||||||
if wait_for_start_writing:
|
if wait_for_start_writing:
|
||||||
|
with contextlib.suppress(asyncio.CancelledError):
|
||||||
await stream.started_writing.wait()
|
await stream.started_writing.wait()
|
||||||
self.assertTrue(os.path.isfile(path))
|
self.assertTrue(os.path.isfile(path))
|
||||||
await self.daemon.file_manager.stop()
|
await self.daemon.file_manager.stop()
|
||||||
|
@ -365,6 +367,7 @@ class RangeRequests(CommandTestCase):
|
||||||
self.assertIsNotNone(stream.full_path)
|
self.assertIsNotNone(stream.full_path)
|
||||||
self.assertEqual(stream.full_path, path)
|
self.assertEqual(stream.full_path, path)
|
||||||
if wait_for_start_writing:
|
if wait_for_start_writing:
|
||||||
|
with contextlib.suppress(asyncio.CancelledError):
|
||||||
await stream.started_writing.wait()
|
await stream.started_writing.wait()
|
||||||
self.assertTrue(os.path.isfile(path))
|
self.assertTrue(os.path.isfile(path))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue