This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author costas-basdekis
Recipients costas-basdekis
Date 2020-12-31.19:18:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1609442293.63.0.396324558319.issue42797@roundup.psfhosted.org>
In-reply-to
Content
Most testing frameworks allow for only a subset of tests to be run, and the reason is usually either to focus on a specific test among many failing ones, or for speed purposes if running the whole suite is too slow.

With doctests, it's usually the case that the are light and fast, but if you make a breaking change you can still have many tests failing, and you want to focus only on one.

This proposition adds an `-m`/`--match` option to the doctest runner, to allow to select 1 or more specific tests to run.

The proposed format for the parameters is :
* <test-name-suffix>:<indexes>
* <test-name-suffix> is a glob-like string where '*' characters can match any substring of a test's name, and an '*' is implicitly added to the start of the pattern: eg 'do_*_method' matches '__main__.do_a_method' and '__main__.MyClass.do_b_method'
* <indexes> is a list of numbers or ranges to match the 0-based index examples within the test:  eg '1' matches the second example, `-3` matches the first 4 examples, '4-` matches all but the first 4 examples, and `-3,5,7-10,20-` matches examples 0, 1, 2, 3, 5, 7, 8, 9, 10, 20, and the rest
History
Date User Action Args
2020-12-31 19:18:13costas-basdekissetrecipients: + costas-basdekis
2020-12-31 19:18:13costas-basdekissetmessageid: <1609442293.63.0.396324558319.issue42797@roundup.psfhosted.org>
2020-12-31 19:18:13costas-basdekislinkissue42797 messages
2020-12-31 19:18:13costas-basdekiscreate