> The issue shows (yet again) a general problem with doctests being
> overspecified -- the test shouldn't care that the output starts with
> 'u', it should only care that the value is unicode, but there's no
> easy way to express this in doctests. But since these doctests exist I
> suggest that the practical way forward is to stick with them rather
> than trying to reformulate all the tests.

Ok, I think I would prefer that. One approach I considered was to
override sys.displayhook, so that I can determine what parts of the
output are "single" repr results. Of course, this wouldn't catch repr
strings that were ultimately print()ed (not sure whether that
restriction would affect Django).

The other (more aggressive) approach is the heuristics you propose,
which may end up with false negatives. doctest already has a wildcard
matching flag, so it would grow another one.

Regards,
Martin

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to