Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: use tomllib/tomli instead of unmaintained toml #63

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ iniconfig!=1.1.0,>=1.0.1
pytest-cov>=2.8.1
pytest-randomly>=3.7.0
pytest-timeout>=1.4.2
toml>=0.10.2
tomli>=1.2.3; python_version < "3.11"
10 changes: 8 additions & 2 deletions tests/test_regressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@

# 3rd party
import pytest
import toml
from domdf_python_tools.compat import PYPY37_PLUS
from domdf_python_tools.paths import PathPlus
from domdf_python_tools.stringlist import StringList
from pytest_regressions.file_regression import FileRegressionFixture

if sys.version_info >= (3, 11): # pragma: no cover
# 3rd party
import tomllib
else: # pragma: no cover
# 3rd party
import tomli as tomllib

# this package
from coincidence.regressions import (
AdvancedDataRegressionFixture,
Expand Down Expand Up @@ -100,7 +106,7 @@ def __len__(self) -> int:
CustomSequence([MappingProxyType({'a': 1})]), id="Nested_CustomSequence_MappingProxyType"
),
pytest.param(CustomMapping({'a': Count(a=1, b=2, c=3)}), id="Nested_CustomMapping_NamedTuple"),
pytest.param(toml.loads(some_toml)["section"]["table"], id="Toml_InlineTableDict"),
pytest.param(tomllib.loads(some_toml)["section"]["table"], id="Toml_InlineTableDict"),
pytest.param(pathlib.PurePath("/foo/bar/baz"), id="pathlib_purepath"),
pytest.param(pathlib.PurePosixPath("/foo/bar/baz"), id="pathlib_pureposixpath"),
pytest.param(pathlib.PureWindowsPath(r"c:\foo\bar\baz"), id="pathlib_purewindowspath"),
Expand Down