All doctests in __init__.py fail
Bug #960063 reported by
Hobson Lane
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
To post a comment you must log in.
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.