[issue32042] Option for comparing values instead of reprs in doctest

Tomáš Petříček report at bugs.python.org
Wed Nov 15 18:32:00 EST 2017


Tomáš Petříček <tpetricek at gmail.com> added the comment:

This option can be seen as a more general case of the options already available which lift the requirement of exact representation match (True for 1, normalize whitespace etc.). It would enable easier testing of relevant behavior instead of repr's artifacts.

An implementation draft is at https://github.com/tpet/cpython/commit/e59cc2d2c854f5995c36a60410eca0e893a7e269

As the expected value has to be reconstructed from the string representation anyway, it seems reasonable to do that for both values (expected and got). Only minor modifications seem to be required in that case.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32042>
_______________________________________


More information about the Python-bugs-list mailing list