Skip to content

Commit

Permalink
Fix doctest
Browse files Browse the repository at this point in the history
  • Loading branch information
bindreams committed Mar 31, 2024
1 parent 69dc758 commit 18dee49
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 4 additions & 3 deletions src/varformat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def format(self, fmtstring: str, /, **kwargs) -> str:
>>> format("Where is ${Kevin}?")
Traceback (most recent call last):
...
KeyError: Kevin
KeyError: 'Kevin'
```
"""
Expand Down Expand Up @@ -157,6 +157,7 @@ def vformat(
Traceback (most recent call last):
...
ValueError: unused arguments: extra
```
"""
references = self._references(fmtstring)
Expand Down Expand Up @@ -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'}
Expand Down

0 comments on commit 18dee49

Please sign in to comment.