X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=modules%2Flibjuju%2Ftests%2Fintegration%2Ftest_unit.py;h=8b2251ccea8f707f87f00d04ba7095c16d93c834;hb=refs%2Fchanges%2F79%2F6379%2F1;hp=1604c311cb5f403b61e61cf9d94cb4a109f34ed9;hpb=68858c1915122c2dbc8999a5cd3229694abf5f3a;p=osm%2FN2VC.git diff --git a/modules/libjuju/tests/integration/test_unit.py b/modules/libjuju/tests/integration/test_unit.py index 1604c31..8b2251c 100644 --- a/modules/libjuju/tests/integration/test_unit.py +++ b/modules/libjuju/tests/integration/test_unit.py @@ -1,8 +1,8 @@ import asyncio -import pytest - from tempfile import NamedTemporaryFile +import pytest + from .. import base @@ -52,6 +52,11 @@ async def test_run_action(event_loop): @base.bootstrapped @pytest.mark.asyncio async def test_scp(event_loop): + # ensure that asyncio.subprocess will work; + try: + asyncio.get_child_watcher().attach_loop(event_loop) + except RuntimeError: + pytest.skip('test_scp will always fail outside of MainThread') async with base.CleanModel() as model: app = await model.deploy('ubuntu')