mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Swap for new ioloop for now
This commit is contained in:
parent
5c8550de75
commit
97a77adc32
2 changed files with 5 additions and 3 deletions
|
@ -617,14 +617,16 @@ def io_loop():
|
|||
"""
|
||||
Create new io loop for each test, and tear it down after.
|
||||
"""
|
||||
|
||||
import asyncio
|
||||
loop = asyncio.new_event_loop()
|
||||
asyncio.set_event_loop(loop)
|
||||
loop = salt.ext.tornado.ioloop.IOLoop.current()
|
||||
loop.make_current()
|
||||
try:
|
||||
yield loop
|
||||
finally:
|
||||
loop.clear_current()
|
||||
# loop.close(all_fds=True)
|
||||
loop.close(all_fds=True)
|
||||
|
||||
|
||||
# <---- Async Test Fixtures ------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -132,7 +132,7 @@ class HTTPTestCase(TestCase):
|
|||
|
||||
url = "http://{host}:{port}/".format(host=host, port=port)
|
||||
result = http.query(url, raise_error=False)
|
||||
assert result == {"body": None}, result
|
||||
assert result == {"error": "[Errno 111] Connection refused"}, result
|
||||
|
||||
def test_query_error_handling(self):
|
||||
ret = http.query("http://127.0.0.1:0")
|
||||
|
|
Loading…
Add table
Reference in a new issue