Skip to content

xdoctest compatability / integration #323

@Erotemic

Description

@Erotemic

Hi, I'm the author of xdoctest

Both xdoctest and pytest-doctestplus have similar goals, with each of them having their own strengths. Something doctestplus seems to stand out in is grabbing tests from documentation. I think xdoctest stands out with its parser and execution harness. Something both do is make the output checking more flexible, but each in their own way.

I'm wondering if there would be interest in working towards compatability so the two tools play nicely with each other. On my end, I'm working on a branch that aims to add doctestplus compatability: Erotemic/xdoctest#205

The goal of this branch is to make it very easy for doctestplus to swap out the stdlib doctest module with xdoctest, and use it with a similar API. I already landed two other PRs that add configuration options to disable some of xdoctest's more opinionated behavior, so it behaves exactly like stdlib doctest except for the improved parser (i.e. deferred output matching and optional output matching).

The current PR is working to add support for the doctestplus directives. Originally I was going to implement them independently in xdoctest, but I think the better move is to make xdoctest have a pluggable OutputChecker so the doctestplus output_checker.py would require very little modification.

I'm probably not going to finish everything this weekend, so before I sink too much time into it, I wanted to see how the maintainers of doctestplus felt about this. My thought is that initial integration should like like: try to import xdoctest, if it is there use it, otherwise fallback to stdlib doctest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions