Skip to content

Commit

Permalink
Print result of doctest failure
Browse files Browse the repository at this point in the history
  • Loading branch information
niccokunzmann committed Dec 21, 2024
1 parent 4725c1b commit c0bc1e3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/icalendar/tests/test_with_doctest.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ def test_documentation_file(document, zoneinfo_only, env_for_doctest, tzp):
functions are also replaced to work.
"""
try:
import pytz
except ImportError:
pytest.skip("pytz not installed, skipping this file.")
try:
# set raise_on_error to False if you wand to see the error for debug
test_result = doctest.testfile(
document, module_relative=False, globs=env_for_doctest, raise_on_error=True
document, module_relative=False, globs=env_for_doctest, raise_on_error=False
)
except doctest.UnexpectedException as e:
ty, err, tb = e.exc_info
if issubclass(ty, ModuleNotFoundError) and err.name == "pytz":
pytest.skip("pytz not installed, skipping this file.")
finally:
tzp.use_zoneinfo()
assert (
Expand Down

0 comments on commit c0bc1e3

Please sign in to comment.