From 004a45ffbcda1325db0c61c0ed11010a22fb1dbf Mon Sep 17 00:00:00 2001 From: Jan Kowalleck Date: Mon, 23 Sep 2024 17:41:28 +0200 Subject: [PATCH] tests: use `tomli` Signed-off-by: Jan Kowalleck --- pyproject.toml | 2 +- tests/__init__.py | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9470f8df..e307963c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -94,7 +94,7 @@ pep8-naming = "0.14.1" isort = "5.13.2" autopep8 = "2.3.1" mypy = "1.11.2" -toml = { version="0.10.2", python="<3.11"} +tomli = { version = "2.0.1", python = "<3.11" } tox = "4.20.0" xmldiff = "2.7.0" bandit = "1.7.9" diff --git a/tests/__init__.py b/tests/__init__.py index 7eab41d6..93111a22 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -196,9 +196,7 @@ def __name__(self) -> str: def load_pyproject() -> Dict[str, Any]: if sys.version_info >= (3, 11): from tomllib import load as toml_load - with open(path.join(path.dirname(__file__), '..', 'pyproject.toml'), 'rb') as f: - return toml_load(f) else: - from toml import load as toml_load - with open(path.join(path.dirname(__file__), '..', 'pyproject.toml'), 'rt') as f: - return toml_load(f) + from tomli import load as toml_load + with open(path.join(path.dirname(__file__), '..', 'pyproject.toml'), 'rb') as f: + return toml_load(f)