All doctests in __init__.py fail

Bug #960063 reported by Hobson Lane
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pyexiv2
Confirmed
Low
Unassigned

Bug Description

Because the path to the image files is unpredictable and doctests hard-coded the path, all doctests fail.
Also, one doctest alters the date to the current date and then checks to see that it matchs a hardcoded/fixed date, so this test will only pass once and then fail on any subsequent runs.
Fixes to all theses tests are incoporated into the lp:/~hobs/pyexiv2/pyexiv2 branch.

Related branches

Revision history for this message
Olivier Tilloy (osomon) wrote :

Thanks for the report Hobson, and for your attention to details :)

The example code in the module docstring for src/pyexiv2/__init__.py was never meant to be actually executed as doctests, which is the reason why it fails. As you found out, making it work reliably is not trivial and IMHO makes the code less readable, which is kind of a no-go as it’s supposed to be easy-to-read and understand example code.

The code base already contains a comprehensive battery of unit tests so I don’t think doctests are needed. I guess the easiest solution is to ensure the example code is not parsed as valid doctests.

Changed in pyexiv2:
importance: Medium → Low
status: New → Confirmed
summary: - All doctests in __init__.py Fail
+ All doctests in __init__.py fail
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.