File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66from tempfile import NamedTemporaryFile
77import pytest
88
9- from juju import utils
9+ from juju import utils , jasyncio
1010
1111from .. import base
1212
@@ -137,7 +137,7 @@ async def run_action(unit):
137137async def test_scp (event_loop ):
138138 # ensure that asyncio.subprocess will work;
139139 try :
140- asyncio .get_child_watcher ().attach_loop (event_loop )
140+ asyncio .get_child_watcher ().attach_loop (jasyncio . get_running_loop () )
141141 except RuntimeError :
142142 pytest .skip ('test_scp will always fail outside of MainThread' )
143143 async with base .CleanModel () as model :
@@ -171,7 +171,7 @@ async def test_scp(event_loop):
171171async def test_ssh (event_loop ):
172172 # ensure that asyncio.subprocess will work;
173173 try :
174- asyncio .get_child_watcher ().attach_loop (event_loop )
174+ asyncio .get_child_watcher ().attach_loop (jasyncio . get_running_loop () )
175175 except RuntimeError :
176176 pytest .skip ('test_ssh will always fail outside of MainThread' )
177177 async with base .CleanModel () as model :
You can’t perform that action at this time.
0 commit comments