diff --git a/pyproject.toml b/pyproject.toml index 1344369..78dd549 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -80,7 +80,8 @@ ignore_errors = true [tool.pytest.ini_options] testpaths = ["tests"] -# The tests import their helpers as tests.conftest, also under a bare pytest. +# The tests import their helpers by their own name (conftest, test_ipmi): a package +# "tests" may come with a dependency (textfsm 2.1.1 ships one). pythonpath = ["."] [tool.coverage.run] diff --git a/tests/test_bmc_driver.py b/tests/test_bmc_driver.py index c06adb5..0a55433 100644 --- a/tests/test_bmc_driver.py +++ b/tests/test_bmc_driver.py @@ -12,13 +12,13 @@ import json from pathlib import Path import pytest +from conftest import BASE_URL, FIXTURES, MockupServer from napalm_device_types import ManagementControllerDriver from napalm_device_types.roles import primary_role_of +from test_ipmi import FakeCommand import napalm_redfish.ipmi as ipmi from napalm_redfish.bmc import BmcDriver -from tests.conftest import BASE_URL, FIXTURES, MockupServer -from tests.test_ipmi import FakeCommand X10 = Path(__file__).parent / "fixtures" / "supermicro-x10drl-i-3.91" MOCKUP = "supermicro-x10drl-i-3.91/redfish" diff --git a/tests/test_time_sync.py b/tests/test_time_sync.py index ad0075c..fc32780 100644 --- a/tests/test_time_sync.py +++ b/tests/test_time_sync.py @@ -201,7 +201,7 @@ def test_the_zone_is_refused(driver): @pytest.fixture def bmc_driver(server, monkeypatch): - from tests.test_ipmi import FakeCommand + from test_ipmi import FakeCommand FakeCommand.instances = [] monkeypatch.setattr(ipmi, "Command", FakeCommand) diff --git a/tests/test_x10_redfish.py b/tests/test_x10_redfish.py index 31c7c5c..9807c16 100644 --- a/tests/test_x10_redfish.py +++ b/tests/test_x10_redfish.py @@ -10,10 +10,10 @@ files hold the error body the BMC sent. import json import pytest +from conftest import BASE_URL, FIXTURES, MockupServer from napalm_device_types import models from napalm_redfish import RedfishDriver -from tests.conftest import BASE_URL, FIXTURES, MockupServer MOCKUP = "supermicro-x10drl-i-3.91/redfish" REFUSED = json.loads((FIXTURES / MOCKUP / "STATUS.json").read_text())