mirror of https://github.com/m-labs/artiq.git
worker, scheduler: fix unit tests on Windows
This commit is contained in:
parent
7db0498a9a
commit
4a16ea111c
|
@ -1,6 +1,7 @@
|
||||||
import unittest
|
import unittest
|
||||||
import asyncio
|
import asyncio
|
||||||
import sys
|
import sys
|
||||||
|
import os
|
||||||
from time import time, sleep
|
from time import time, sleep
|
||||||
|
|
||||||
from artiq import *
|
from artiq import *
|
||||||
|
@ -63,7 +64,10 @@ _handlers = {
|
||||||
|
|
||||||
class SchedulerCase(unittest.TestCase):
|
class SchedulerCase(unittest.TestCase):
|
||||||
def setUp(self):
|
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)
|
asyncio.set_event_loop(self.loop)
|
||||||
|
|
||||||
def test_steps(self):
|
def test_steps(self):
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import unittest
|
import unittest
|
||||||
import asyncio
|
import asyncio
|
||||||
import sys
|
import sys
|
||||||
|
import os
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
from artiq import *
|
from artiq import *
|
||||||
|
@ -59,7 +60,10 @@ def _run_experiment(class_name):
|
||||||
|
|
||||||
class WatchdogCase(unittest.TestCase):
|
class WatchdogCase(unittest.TestCase):
|
||||||
def setUp(self):
|
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)
|
asyncio.set_event_loop(self.loop)
|
||||||
|
|
||||||
def test_watchdog_no_timeout(self):
|
def test_watchdog_no_timeout(self):
|
||||||
|
|
Loading…
Reference in New Issue