X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FN2VC.git;a=blobdiff_plain;f=modules%2Flibjuju%2Ftests%2Fintegration%2Ftest_machine.py;fp=modules%2Flibjuju%2Ftests%2Fintegration%2Ftest_machine.py;h=8957ae16b6330847b31624d9eb4cba19d6eae562;hp=cabf46d7f2bd784d1d83b6c9608864197d9c00ad;hb=c3e6c2ec9a1fddfc8e9bd31509b366e633b6d99e;hpb=1a15d1c84fc826fa7996c1c9d221a324edd33432 diff --git a/modules/libjuju/tests/integration/test_machine.py b/modules/libjuju/tests/integration/test_machine.py index cabf46d..8957ae1 100644 --- a/modules/libjuju/tests/integration/test_machine.py +++ b/modules/libjuju/tests/integration/test_machine.py @@ -1,8 +1,8 @@ import asyncio -import pytest - from tempfile import NamedTemporaryFile +import pytest + from .. import base @@ -42,6 +42,11 @@ async def test_status(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: await model.add_machine() await asyncio.wait_for(