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 vstinner
Recipients vstinner
Date 2011-05-31.23:56:11
SpamBayes Score 5.4972643e-06
Marked as misclassified No
Message-id <1306886173.49.0.536773734975.issue12231@psf.upfronthosting.co.za>
In-reply-to
Content
Attached patch adds -k/--func-regex and -K/--file-regex options to filter tests by function/file names. It modifies makeSuite() and getTestCaseNames() functions of unittest.loader to add an optional filter argument: callback taking a function name as argument and returning False if the test should be ignored. You can use the new options more than once and their argument are regular expressions (case insensitive).

Examples:

- "./python -m test -k subprocess -K pass_fds" runs only 1 function of 1 file: test_subprocess.test_pass_fds()
- "./python -m test -k os$" runs 1 file: test_os
- "./python -m test -K codecencoding" runs 6 files: test_codecencodings_cn, test_codecencodings_hk, test_codecencodings_iso2022, test_codecencodings_jp, test_codecencodings_kr, test_codecencodings_tw
History
Date User Action Args
2011-05-31 23:56:14vstinnersetrecipients: + vstinner
2011-05-31 23:56:13vstinnersetmessageid: <1306886173.49.0.536773734975.issue12231@psf.upfronthosting.co.za>
2011-05-31 23:56:12vstinnerlinkissue12231 messages
2011-05-31 23:56:12vstinnercreate