X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FN2VC.git;a=blobdiff_plain;f=modules%2Flibjuju%2Ftests%2Fintegration%2Ftest_unit.py;h=8b2251ccea8f707f87f00d04ba7095c16d93c834;hp=1604c311cb5f403b61e61cf9d94cb4a109f34ed9;hb=c3e6c2ec9a1fddfc8e9bd31509b366e633b6d99e;hpb=1a15d1c84fc826fa7996c1c9d221a324edd33432 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')