Fix tests on python 3.4 (#1046)

This commit is contained in:
Julien Duponchelle authored and GitHub committed 2017-05-23 12:15:04 +02:00
1 parent 54e80d68f8
commit 59488e8064
2 files changed
+5 -2

No files matched your search

+1 -1
View File
@@ -287,7 +287,7 @@ class GNS3VM:
yield from engine.start()
except Exception as e:
yield from self._controller.delete_compute("vm")
log.error("Can't start the GNS3 VM: {}", str(e))
log.error("Can't start the GNS3 VM: {}".format(str(e)))
yield from compute.update(name="GNS3 VM ({})".format(engine.vmname))
raise e
yield from compute.update(name="GNS3 VM ({})".format(engine.vmname),
+4 -1
View File
@@ -70,7 +70,10 @@ class AsyncioMagicMock(unittest.mock.MagicMock):
"""
Magic mock returning coroutine
"""
__class__ = types.CoroutineType
try:
__class__ = types.CoroutineType
except AttributeError: # Not supported with Python 3.4
__class__ = types.GeneratorType
def __init__(self, return_value=None, return_values=None, **kwargs):
"""