1010from unittest import mock
1111
1212import paramiko
13- import pylxd
1413import pytest
1514
1615from juju import jasyncio , tag , url
2928from ..utils import GB , INTEGRATION_TEST_DIR , MB , OVERLAYS_DIR , SSH_KEY , TESTS_DIR
3029
3130
31+ @pytest .fixture
32+ def pylxd ():
33+ return pytest .importorskip ("pylxd" )
34+
35+
3236@base .bootstrapped
3337async def test_model_name ():
3438 model = Model ()
@@ -532,7 +536,7 @@ async def test_add_machine():
532536 assert len (model .machines ) == 0
533537
534538
535- async def add_manual_machine_ssh (is_root = False ):
539+ async def add_manual_machine_ssh (pylxd , is_root = False ):
536540 # Verify controller is localhost
537541 async with base .CleanController () as controller :
538542 cloud = await controller .get_cloud ()
@@ -677,7 +681,7 @@ def wait_for_network(container, timeout=30):
677681
678682
679683@base .bootstrapped
680- async def test_add_manual_machine_ssh ():
684+ async def test_add_manual_machine_ssh (pylxd ):
681685 """Test manual machine provisioning with a non-root user.
682686
683687 Tests manual machine provisioning using a randomized username with
@@ -687,9 +691,9 @@ async def test_add_manual_machine_ssh():
687691
688692
689693@base .bootstrapped
690- async def test_add_manual_machine_ssh_root ():
694+ async def test_add_manual_machine_ssh_root (pylxd ):
691695 """Test manual machine provisioning with the root user."""
692- await add_manual_machine_ssh (is_root = True )
696+ await add_manual_machine_ssh (pylxd , is_root = True )
693697
694698
695699@base .bootstrapped
0 commit comments