Skip to content

Commit

Permalink
Provide running loop in tests where event_loop is needed
Browse files Browse the repository at this point in the history
  • Loading branch information
cderici committed Jan 10, 2024
1 parent d4ce751 commit e0df1cb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/integration/test_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from tempfile import NamedTemporaryFile
import pytest

from juju import utils
from juju import utils, jasyncio

from .. import base

Expand Down Expand Up @@ -160,7 +160,7 @@ def check_results(results, out):
async def test_scp():
# ensure that asyncio.subprocess will work;
try:
asyncio.get_child_watcher().attach_loop()
asyncio.get_child_watcher().attach_loop(jasyncio.get_running_loop())
except RuntimeError:
pytest.skip('test_scp will always fail outside of MainThread')
async with base.CleanModel() as model:
Expand Down Expand Up @@ -193,7 +193,7 @@ async def test_scp():
async def test_ssh():
# ensure that asyncio.subprocess will work;
try:
asyncio.get_child_watcher().attach_loop()
asyncio.get_child_watcher().attach_loop(jasyncio.get_running_loop())
except RuntimeError:
pytest.skip('test_ssh will always fail outside of MainThread')
async with base.CleanModel() as model:
Expand Down

0 comments on commit e0df1cb

Please sign in to comment.