From 7f43445aa3f43e640650779f34b753d5a2558fed Mon Sep 17 00:00:00 2001
From: Jonathan Moody <103143855+moodyjon@users.noreply.github.com>
Date: Sat, 9 Jul 2022 06:12:32 -0400
Subject: [PATCH] Try to suppress asyncio.CancelledError in a different way in
 test_streaming.py.

---
 tests/integration/datanetwork/test_streaming.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tests/integration/datanetwork/test_streaming.py b/tests/integration/datanetwork/test_streaming.py
index 4f60e8909..9e383b25d 100644
--- a/tests/integration/datanetwork/test_streaming.py
+++ b/tests/integration/datanetwork/test_streaming.py
@@ -3,6 +3,7 @@ import hashlib
 import aiohttp
 import aiohttp.web
 import asyncio
+import contextlib
 
 from lbry.file.source import ManagedDownloadSource
 from lbry.utils import aiohttp_request
@@ -353,7 +354,8 @@ class RangeRequests(CommandTestCase):
         path = stream.full_path
         self.assertIsNotNone(path)
         if wait_for_start_writing:
-            await stream.started_writing.wait()
+            with contextlib.suppress(asyncio.CancelledError):
+                await stream.started_writing.wait()
             self.assertTrue(os.path.isfile(path))
         await self.daemon.file_manager.stop()
         # while stopped, we get no response to query and no file is present
@@ -365,7 +367,8 @@ class RangeRequests(CommandTestCase):
         self.assertIsNotNone(stream.full_path)
         self.assertEqual(stream.full_path, path)
         if wait_for_start_writing:
-            await stream.started_writing.wait()
+            with contextlib.suppress(asyncio.CancelledError):
+                await stream.started_writing.wait()
             self.assertTrue(os.path.isfile(path))
 
     async def test_file_save_stop_before_finished_streaming_only_wait_for_start(self):