diff --git a/pyproject.toml b/pyproject.toml index 45374fd..ef6d76c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,7 +46,7 @@ addopts = [ "--doctest-glob=README.md", "--ignore-glob=scripts" ] -doctest_optionflags = "IGNORE_EXCEPTION_DETAIL" +doctest_optionflags = "ELLIPSIS" [tool.black] line-length = 120 diff --git a/src/varformat/__init__.py b/src/varformat/__init__.py index 5085476..e07d2fb 100644 --- a/src/varformat/__init__.py +++ b/src/varformat/__init__.py @@ -123,7 +123,7 @@ def format(self, fmtstring: str, /, **kwargs) -> str: >>> format("Where is ${Kevin}?") Traceback (most recent call last): ... - KeyError: Kevin + KeyError: 'Kevin' ``` """ @@ -157,6 +157,7 @@ def vformat( Traceback (most recent call last): ... ValueError: unused arguments: extra + ``` """ references = self._references(fmtstring) @@ -211,8 +212,8 @@ def parse(self, fmtstring: str, /, string: str, *, ambiguity_check=True) -> Unio >>> parse("Model-${X}-${Y}", "Model-X1-155-91") Traceback (most recent call last): ... - AmbiguityError: parsing is ambiguous: - could be: {'X': 'X1-155', 'Y': '91'} + varformat.AmbiguityError: parsing is ambiguous: + could be: {'X': 'X1-155', 'Y': '91'} or: {'X': 'X1', 'Y': '155-91'} >>> parse("Model-${X}-${Y}", "Model-X1-155-91", ambiguity_check=False) {'X': 'X1-155', 'Y': '91'}