Python code modernization, 8/n (#1179)

* Use to_text instead of to_native.

* Remove no longer needed pylint ignores.

* Remove another pylint ignore.

* Remove no longer needed ignore.

* Address redefined-outer-name.

* Address consider-using-with.
This commit is contained in:
Felix Fontein
2025-10-25 02:36:04 +02:00
committed by GitHub
parent 6ad4bfcd40
commit be000755fc
30 changed files with 156 additions and 150 deletions
@@ -24,14 +24,14 @@ if t.TYPE_CHECKING:
from collections.abc import Callable
@pytest.fixture(scope="module")
def templar() -> Templar:
@pytest.fixture(scope="module", name="templar")
def templar_fixture() -> Templar:
dataloader = create_autospec(DataLoader, instance=True)
return Templar(loader=dataloader)
@pytest.fixture(scope="module")
def inventory(templar: Templar) -> InventoryModule:
@pytest.fixture(scope="module", name="inventory")
def inventory_fixture(templar: Templar) -> InventoryModule:
r = InventoryModule()
r.inventory = InventoryData()
r.templar = templar