ward icon indicating copy to clipboard operation
ward copied to clipboard

Question: Is there anything similar to `pytest --doctest-modules`?

Open FollowTheProcess opened this issue 3 years ago • 2 comments
trafficstars

Hi!

I'm just trying out ward on some projects, porting over tests from pytest because I like new and shiny things! I have to say I really like ward so great job on an awesome tool! The incredibly clear diffs on failures are just a joy compared to pytest!

I have some projects where I put examples in the docstrings of public methods and I usually test these with pytest --doctest-modules. Is there anything similar to this in ward, plans to implement in the future or even a current workaround to achieve this?

Thanks for the great project!

FollowTheProcess avatar Jan 22 '22 05:01 FollowTheProcess

Hey, glad you're enjoying it!

This is something I never really thought about - I guess because development of Ward was heavily influenced by my own experience testing and I've never used doctest before. I think it sounds like a great idea though.

Unfortunately it's not something I'm really familiar with and so don't know how you might workaround it.

When I pick development of Ward back up in the future (on a bit of a hiatus at the moment ;)), I'll most likely dig into this more. In the mean time, if you or anyone else wants to create a proposal and/or a PR I'd be totally open to that.

Cheers!

darrenburns avatar Mar 19 '22 17:03 darrenburns

Awesome! I'll definitely see if I can contribute a solution, I think pytest more or less just calls the stdlib doctest module when required so it shouldn't be too strenuous!

FollowTheProcess avatar Mar 20 '22 00:03 FollowTheProcess