fix(tests): import the test helpers by their own name
driver / standard (pull_request) Successful in 16s
driver / lint (pull_request) Successful in 14s
driver / types (pull_request) Successful in 59s
driver / test (3.12) (pull_request) Successful in 1m1s
driver / test (3.13) (pull_request) Successful in 53s
driver / lowest (pull_request) Successful in 28s
driver / build (pull_request) Successful in 26s
driver / security (pull_request) Successful in 54s
CI / driver (pull_request) Successful in 2m25s
driver / publish (pull_request) Skipped

textfsm 2.1.1 (2026-11-10, through napalm) installs a top-level package
"tests" into site-packages. It shadows this repo's tests directory, which
is no package, so "from tests.conftest import ..." found textfsm's and
test_bmc_driver.py and test_x10_redfish.py failed to import: every test
run on CI fails since that release, main included.

The helpers are imported as conftest and test_ipmi, the way
test_driver.py already does; pytest puts tests/ on the path for them.
This commit is contained in:
Christian Manivong committed 2026-11-11 15:43:27 +01:00
1 parent daa7dc9726
commit 679ff20f94
4 files changed
+6 -5

No files matched your search

+2 -2
View File
@@ -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"
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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())