Skip to content

Commit

Permalink
use eventkit.util.get_event_loop() in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gnzsnz committed Aug 28, 2024
1 parent 9ecec8d commit 8681633
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tests/create_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
import unittest

from eventkit import Event
from eventkit.util import get_event_loop

array1 = list(range(10))
array2 = list(range(100, 110))


class CreateTest(unittest.TestCase):
def test_wait(self):
loop = asyncio.get_event_loop_policy().get_event_loop()
loop = get_event_loop()
fut = asyncio.Future(loop=loop)
loop.call_later(0.001, fut.set_result, 42)
event = Event.wait(fut)
Expand Down
3 changes: 2 additions & 1 deletion tests/event_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@

import eventkit as ev
from eventkit import Event
from eventkit.util import get_event_loop


def run(*args, **kwargs):
loop = asyncio.get_event_loop_policy().get_event_loop()
loop = get_event_loop()
return loop.run_until_complete(*args, **kwargs)


Expand Down

0 comments on commit 8681633

Please sign in to comment.