Message137402
| 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:14 | vstinner | set | recipients:
+ vstinner |
| 2011年05月31日 23:56:13 | vstinner | set | messageid: <1306886173.49.0.536773734975.issue12231@psf.upfronthosting.co.za> |
| 2011年05月31日 23:56:12 | vstinner | link | issue12231 messages |
| 2011年05月31日 23:56:12 | vstinner | create |
|