Steven D'Aprano <steve+pyt...@pearwood.info> added the comment:
I think that -m is unacceptable as it will clash with Python's -m option. I'm not convinced that this added complexity will provide enough benefit to make it worth while. I can see myself spending an order of magnitude more time trying to work out why my test suffixes and indexes are selecting the wrong tests than I would save. The use of indexes to select individual tests within a single docstring is especially fragile and error-prone since it requires counting by the user. It's also likely to introduce artificial errors since tests can rely on side-effects of previous tests, e.g. >>> import math >>> math.sqrt(25) 5.0 Selecting test number 1 alone will fail unless test number 0 is also run. For these reasons, I think that in practice, the finest selection unit we can run is a single docstring. Trying to select individual tests within a unit is likely to be far too fragile and error prone to be practical. So by my estimation, we have the following selections: - module docstring alone - named function or class docstring alone - named class.method docstring alone - named class and all its methods ---------- nosy: +steven.daprano, tim.peters _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue42797> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com