summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2016-10-31 01:12:50 +0100
committerlouiz’ <louiz@louiz.org>2016-10-31 01:39:35 +0100
commitfdf336afa017c24eb483f741e4037226f8a08401 (patch)
treedec6087ca2929a70ad8ea7351eecbac62bc58d23 /tests
parent1d6aa89ab9656878689d86bd1aa74140756740fd (diff)
downloadbiboumi-fdf336afa017c24eb483f741e4037226f8a08401.tar.gz
biboumi-fdf336afa017c24eb483f741e4037226f8a08401.tar.bz2
biboumi-fdf336afa017c24eb483f741e4037226f8a08401.tar.xz
biboumi-fdf336afa017c24eb483f741e4037226f8a08401.zip
Use ensure_future if available, otherwise use asyncio.async
Diffstat (limited to 'tests')
-rw-r--r--tests/end_to_end/__main__.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/end_to_end/__main__.py b/tests/end_to_end/__main__.py
index a591bc9..c98c3a6 100644
--- a/tests/end_to_end/__main__.py
+++ b/tests/end_to_end/__main__.py
@@ -13,6 +13,8 @@ import os
from functools import partial
from slixmpp.xmlstream.matcher.base import MatcherBase
+if not hasattr(asyncio, "ensure_future"):
+ asyncio.ensure_future = getattr(asyncio, "async")
class MatchAll(MatcherBase):
"""match everything"""
@@ -57,7 +59,7 @@ class XMPPComponent(slixmpp.BaseXMPP):
self.add_event_handler("session_end", self.on_end_session)
- asyncio.async(self.accept_routine())
+ asyncio.ensure_future(self.accept_routine())
self.scenario = scenario
self.biboumi = biboumi