Skip to content

Commit

Permalink
Add sent_report_count to AsyncIntegrationTest
Browse files Browse the repository at this point in the history
  • Loading branch information
imjoehaines committed Aug 11, 2023
1 parent 48c287a commit 90b9ee7
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tests/async_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@
class AsyncIntegrationTest(IsolatedAsyncioTestCase):
async def asyncSetUp(self):
self.server = FakeBugsnag()
bugsnag.configure(asynchronous=True,
endpoint=self.server.events_url,
session_endpoint=self.server.sessions_url,
api_key='ffffffffffffffffff')
self.sent_report_count = 0
bugsnag.configure(
asynchronous=True,
endpoint=self.server.events_url,
session_endpoint=self.server.sessions_url,
api_key='ffffffffffffffffff'
)

async def asyncTearDown(self):
bugsnag.legacy.default_client.uninstall_sys_hook()
Expand All @@ -29,7 +32,9 @@ async def poll():
while len(self.server.events_received) == 0:
await asyncio.sleep(0.1)

self.sent_report_count += 1
return self.server.events_received.pop()

try:
return await asyncio.wait_for(poll(), timeout=1.0)
except asyncio.TimeoutError:
Expand Down

0 comments on commit 90b9ee7

Please sign in to comment.