Files
chia-blockchain/chia/_tests/cmds/conftest.py
Kyle AltendorfandGitHub 9c8557a1f8 Remove Python 3.8 support and update source to 3.9 standards (#18687)
* manual python 3.8 removals

* poetry

* pyupgrade

* black

* isort

* manually tidy imports

* work around shadowed type

* catch up build network protocol files for pyupgrade changes

* placate pylint

* re-enable 20.04

* placate flake8
2024-10-16 14:21:15 -07:00

24 lines
991 B
Python

from __future__ import annotations
import tempfile
from collections.abc import Iterator
from pathlib import Path
import pytest
from chia._tests.cmds.cmd_test_utils import TestRpcClients, create_service_and_wallet_client_generators
from chia.util.config import create_default_chia_config
@pytest.fixture(scope="module") # every file has its own config generated, just to be safe
def get_test_cli_clients() -> Iterator[tuple[TestRpcClients, Path]]:
# we cant use the normal config fixture because it only supports function scope.
with tempfile.TemporaryDirectory() as tmp_path:
root_path: Path = Path(tmp_path) / "chia_root"
root_path.mkdir(parents=True, exist_ok=True)
create_default_chia_config(root_path)
# ^ this is basically the generate config fixture.
global_test_rpc_clients = TestRpcClients()
create_service_and_wallet_client_generators(global_test_rpc_clients, root_path)
yield global_test_rpc_clients, root_path