Including doc tests into unit tests session
how to run doctests in your unit tests session
doctest could be very convenient. Mostly in cases if usage examples are the best tests for the code.
But if you add doc-tests in your project where you use unitests you’ve got a problem - how to get just one test result.
If you want one result to see and to use in CI you can include doc-tests into unit-tests session.
I use load_tests protocol to create unit tests wrappers for doc tests and add them to the unit test session.
As a result we will have just one exit code, for unit tests and for doc tests.
Another bonus - more clear test report.