Sorting modules for doctest

22 views
Skip to first unread message

Zach R

unread,
Feb 17, 2021, 4:46:07 PM2/17/21
to sphinx-users
Hello!

Love Sphinx and have been using it for years.

One thing that I've never managed to get set up is to have the doctests all done in a deterministic (preferably alphabetic) order when run with "sphinx -b doctest"

Is there any way to do this easily?

Thanks!
Zach

Luc Saffre

unread,
Feb 18, 2021, 4:16:53 AM2/18/21
to sphinx...@googlegroups.com, Zach R
I use an external tool (atelier, written by myself) to run doctest on every document of my Sphinx doctrees. It sorts the docs alphabetically to avoid such surprises:

https://www.lino-framework.org/dev/doctests.html

IOW, create a subdirectory "tests" next to your docs directory, create a file test_docs.py in that directory as described, then run "pip install atelier" and "python -m unittest discover -s tests".

hth
Luc
--
You received this message because you are subscribed to the Google Groups "sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/25b1d333-f060-4dc0-ad53-f61fc73784a8n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages