Developing With Doctests - Using Xdoctest As A Backend
summary
Doctests get a practical overhaul: Xdoctest replaces regex parsing with an AST-based parser, accepts a single >>> rule for all statements, adds pytest integration and directives like requires/skip/ignore-want, and can target files, modules or whole packages while printing colored, reproducible failure commands. It trades a bit of speed and perfect backward compatibility for smoother running; it powers ubelt to 100% test coverage and shows odd metrics (34 GitHub stars vs ~3.4k monthly downloads).
AI-written summary · about
chapters (23)
- 0:00Intro
- 0:53What Are Doctests?
- 1:51What Can Doctests Do?
- 3:44How To Write A Doctest
- 6:14Fixing Case Study #1
- 7:55Debugging
- 8:31Fixing Case Study #2
- 9:16Why Aren't Doctests Everywhere?
- 10:10The Xdoctest Module
- 11:10A Quick Aside On Formal Languages
- 12:14Theory And Practice
- 13:49Revisit Case Study #1
- 15:56Xdoctest Is Easier To Run
- 16:54Xdoctest Has Better Output
- 17:35Xdoctest Has Better Directives
- 20:14Xdoctest Has A Pytest Plugin
- 20:43When Your Doctests Work
- 21:13When Your Doctests Fail
- 22:27Miscellaneous Features
- 23:45Limitations
- 24:42Doctest Versus Xdoctest
- 26:03Contribution
- 26:52Summary And Conclusion
related talks
51mMix Tests and Production Code With Doctest...
38mTesting with Elixir/Erlang
39mPainless Test Driven Development with Elixir and Phoenix
28mEgad! How Do We Start Writing Better Tests?
30mATDD with CodeceptJS: Effective Testing Without Pain
38mDocs as Tests: A Strategy for Resilient Docs
37mDelicious Controversy: Docs & Tests
41mTesting is Fun in Python!
