Skip to content

Commit

Permalink
worker, scheduler: fix unit tests on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
fallen committed Aug 27, 2015
1 parent 7db0498 commit 4a16ea1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion artiq/test/scheduler.py
@@ -1,6 +1,7 @@
import unittest
import asyncio
import sys
import os
from time import time, sleep

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

class SchedulerCase(unittest.TestCase):
def setUp(self):
self.loop = asyncio.new_event_loop()
if os.name == "nt":
self.loop = asyncio.ProactorEventLoop()
else:
self.loop = asyncio.new_event_loop()
asyncio.set_event_loop(self.loop)

def test_steps(self):
Expand Down
6 changes: 5 additions & 1 deletion artiq/test/worker.py
@@ -1,6 +1,7 @@
import unittest
import asyncio
import sys
import os
from time import sleep

from artiq import *
Expand Down Expand Up @@ -59,7 +60,10 @@ def _run_experiment(class_name):

class WatchdogCase(unittest.TestCase):
def setUp(self):
self.loop = asyncio.new_event_loop()
if os.name == "nt":
self.loop = asyncio.ProactorEventLoop()
else:
self.loop = asyncio.new_event_loop()
asyncio.set_event_loop(self.loop)

def test_watchdog_no_timeout(self):
Expand Down

0 comments on commit 4a16ea1

Please sign in to comment.