tests/functional2/lang: replace toml with tomllib
currenlty we use the external package `toml`, this just adds an unnessecary dependency, as python ships its own toml as `tomllib` Change-Id: Ia63fa7558973e853ada20cbfa21d897d700444f8
This commit is contained in:
@@ -216,7 +216,6 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
p.pytest-xdist
|
||||
p.ruff
|
||||
p.aiohttp
|
||||
p.toml
|
||||
]
|
||||
);
|
||||
|
||||
@@ -533,7 +532,6 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
p.ruff
|
||||
p.aiohttp
|
||||
p.python-frontmatter
|
||||
p.toml
|
||||
p.pycapnp
|
||||
|
||||
p.yapf
|
||||
|
||||
@@ -7,10 +7,10 @@ from pathlib import Path
|
||||
from typing import Any, NamedTuple, ClassVar
|
||||
from collections.abc import Generator
|
||||
|
||||
import toml
|
||||
import tomllib
|
||||
from functional2.testlib.fixtures.file_helper import AssetSymlink, CopyFile, FileDeclaration
|
||||
from functional2.testlib.utils import is_value_of_type, test_base_folder
|
||||
from toml import TomlDecodeError
|
||||
from tomllib import TOMLDecodeError
|
||||
|
||||
LANG_TEST_ID_PATTERN = "{folder_name}:{test_name}"
|
||||
|
||||
@@ -303,8 +303,8 @@ def _collect_toml_test_group(folder: Path) -> tuple[list[LangTest], list[Invalid
|
||||
unused_files = all_files - {"test.toml"}
|
||||
|
||||
try:
|
||||
infos: dict[str, Any] = toml.load(folder / "test.toml")
|
||||
except TomlDecodeError as e:
|
||||
infos: dict[str, Any] = tomllib.loads((folder / "test.toml").read_text())
|
||||
except TOMLDecodeError as e:
|
||||
return [], [InvalidLangTest(parent_name, [f"couldn't parse toml: {e!r}"])]
|
||||
|
||||
for test in parse_toml(infos, in_files):
|
||||
|
||||
Reference in New Issue
Block a user