Skip to content

Feature request: doctest report format as an option #1749

Closed
@gtroianowski

Description

@gtroianowski

Adding an option to the plugin to choose the type of report (e.g. None, REPORT_UDIFF, REPORT_NDIFF, REPORT_CDIFF) rather than the hard-coded REPORT_UDIFF

For example

py.test foo.py --doctest-module --doctest-report NONE

Would set REPORT_UDIFF = 0 in _pytest/doctest.py:68 and return:

================================== FAILURES ===================================
______________________________ [doctest] foo.bar ______________________________
013     '''
014     >>> bar()
Expected:
       a  b
    0  1  4
    1  2  4
    2  3  6
Got:
       a  b
    0  1  4
    1  2  5
    2  3  6

while
py.test foo.py --doctest-module --doctest-report UDIFF

would set `REPORT_UDIFF = doctest.REPORT_UDIFF

` in _pytest/doctest.py:68 and return

================================== FAILURES ===================================
______________________________ [doctest] foo.bar ______________________________
013     '''
014     >>> bar()
Differences (unified diff with -expected +actual):
    @@ -1,4 +1,4 @@
        a  b
     0  1  4
    -1  2  4
    +1  2  5
     2  3  6

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueeasy issue that is friendly to new contributorplugin: doctestsrelated to the doctests builtin pluginstatus: help wanteddevelopers would like help from experts on this topic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions