Skip to content

Commit fbe1e63

Browse files
committed
chore: make pylxd optional, as it brings in ws4py from 2018
1 parent 2f07806 commit fbe1e63

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ dev = [
4343
"pytest-asyncio",
4444
"Twine",
4545
"setuptools", # ?
46-
"pylxd",
4746
]
4847

4948
[project.urls]

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
"pytest-asyncio",
4242
"Twine",
4343
"setuptools", # ?
44-
"pylxd",
4544
]
4645
},
4746
include_package_data=True,

tests/integration/test_model.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from unittest import mock
1111

1212
import paramiko
13-
import pylxd
1413
import pytest
1514

1615
from juju import jasyncio, tag, url
@@ -29,6 +28,11 @@
2928
from ..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
3337
async 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

Comments
 (0)