Skip to content

Commit

Permalink
no asyncio tests of scheduler
Browse files Browse the repository at this point in the history
  • Loading branch information
marcin-usielski committed Nov 8, 2024
1 parent d229e10 commit e37edc9
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions test/test_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
from moler.util.moler_test import MolerTest
import time
import pytest
import sys
import asyncio


def test_job():
Expand Down Expand Up @@ -95,18 +93,18 @@ def test_thread_test_job():
assert (3 == values['number'])


@pytest.mark.skipif(sys.version_info < (3, 4), reason="requires python3.4 or higher")
def test_asyncio_test_job():
loop = asyncio.get_event_loop()
Scheduler.change_kind("asyncio")
values = {'number': 0}
job = Scheduler.get_job(callback=callback, interval=0.1, callback_params={'param_dict': values})
job.start()
loop.run_until_complete(asyncio.sleep(0.23))
job.cancel()
loop.stop()
Scheduler.change_kind() # Set the default
assert (2 == values['number'])
# @pytest.mark.skipif(sys.version_info < (3, 4), reason="requires python3.4 or higher")
# def test_asyncio_test_job():
# loop = asyncio.get_event_loop()
# Scheduler.change_kind("asyncio")
# values = {'number': 0}
# job = Scheduler.get_job(callback=callback, interval=0.1, callback_params={'param_dict': values})
# job.start()
# loop.run_until_complete(asyncio.sleep(0.23))
# job.cancel()
# loop.stop()
# Scheduler.change_kind() # Set the default
# assert (2 == values['number'])


def test_cannot_create_more_objects():
Expand Down

0 comments on commit e37edc9

Please sign in to comment.