Skip to content

Commit 4a16ea1

Browse files
committedAug 27, 2015
worker, scheduler: fix unit tests on Windows
1 parent 7db0498 commit 4a16ea1

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed
 

Diff for: ‎artiq/test/scheduler.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import unittest
22
import asyncio
33
import sys
4+
import os
45
from time import time, sleep
56

67
from artiq import *
@@ -63,7 +64,10 @@ def _get_basic_steps(rid, expid, priority=0, flush=False):
6364

6465
class SchedulerCase(unittest.TestCase):
6566
def setUp(self):
66-
self.loop = asyncio.new_event_loop()
67+
if os.name == "nt":
68+
self.loop = asyncio.ProactorEventLoop()
69+
else:
70+
self.loop = asyncio.new_event_loop()
6771
asyncio.set_event_loop(self.loop)
6872

6973
def test_steps(self):

Diff for: ‎artiq/test/worker.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import unittest
22
import asyncio
33
import sys
4+
import os
45
from time import sleep
56

67
from artiq import *
@@ -59,7 +60,10 @@ def _run_experiment(class_name):
5960

6061
class WatchdogCase(unittest.TestCase):
6162
def setUp(self):
62-
self.loop = asyncio.new_event_loop()
63+
if os.name == "nt":
64+
self.loop = asyncio.ProactorEventLoop()
65+
else:
66+
self.loop = asyncio.new_event_loop()
6367
asyncio.set_event_loop(self.loop)
6468

6569
def test_watchdog_no_timeout(self):

0 commit comments

Comments
 (0)
Please sign in to comment.