Remove exception detail from doctest (#5430)

* Remove exception detail from doctest

These details are configuration dependant so should be removed according to https://docs.python.org/3/library/doctest.html

* updating DIRECTORY.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
Christian Clauss
2021-10-19 08:05:20 +02:00
committed by GitHub
parent 66c96aa037
commit aa0ace4df7
2 changed files with 9 additions and 7 deletions

View File

@ -81,11 +81,7 @@ def length_conversion(value: float, from_type: str, to_type: str) -> float:
0.1181103
>>> length_conversion(4, "wrongUnit", "inch")
Traceback (most recent call last):
File "/usr/lib/python3.8/doctest.py", line 1336, in __run
exec(compile(example.source, filename, "single",
File "<doctest __main__.length_conversion[18]>", line 1, in <module>
length_conversion(4, "wrongUnit", "inch")
File "<string>", line 85, in length_conversion
...
ValueError: Invalid 'from_type' value: 'wrongUnit' Supported values are:
meter, kilometer, feet, inch, centimeter, yard, foot, mile, millimeter
"""