Skip to content

Commit e0df1cb

Browse files
committed
Provide running loop in tests where event_loop is needed
1 parent d4ce751 commit e0df1cb

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tests/integration/test_unit.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from tempfile import NamedTemporaryFile
77
import pytest
88

9-
from juju import utils
9+
from juju import utils, jasyncio
1010

1111
from .. import base
1212

@@ -160,7 +160,7 @@ def check_results(results, out):
160160
async def test_scp():
161161
# ensure that asyncio.subprocess will work;
162162
try:
163-
asyncio.get_child_watcher().attach_loop()
163+
asyncio.get_child_watcher().attach_loop(jasyncio.get_running_loop())
164164
except RuntimeError:
165165
pytest.skip('test_scp will always fail outside of MainThread')
166166
async with base.CleanModel() as model:
@@ -193,7 +193,7 @@ async def test_scp():
193193
async def test_ssh():
194194
# ensure that asyncio.subprocess will work;
195195
try:
196-
asyncio.get_child_watcher().attach_loop()
196+
asyncio.get_child_watcher().attach_loop(jasyncio.get_running_loop())
197197
except RuntimeError:
198198
pytest.skip('test_ssh will always fail outside of MainThread')
199199
async with base.CleanModel() as model:

0 commit comments

Comments
 (0)