[issue12231] regrtest: add -k and -K options to filter tests by function/file names

2011-12-18 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Already fixed in #12626.

--
resolution:  -> duplicate
stage: needs patch -> committed/rejected
status: open -> closed
superseder:  -> run test cases based on a glob filter

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12231] regrtest: add -k and -K options to filter tests by function/file names

2011-07-25 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

This patch doesn't work if run_unittest() is called with an already constructed 
test suite or test case (the patch in #12626 does).

--
nosy: +pitrou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12231] regrtest: add -k and -K options to filter tests by function/file names

2011-07-23 Thread Ezio Melotti

Ezio Melotti  added the comment:

See also #12626 for a similar suggestion.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12231] regrtest: add -k and -K options to filter tests by function/file names

2011-07-01 Thread STINNER Victor

STINNER Victor  added the comment:

regrtest_regex-2.patch: minor update, just ensure that the patch applies 
correctly on the default branch.

--
Added file: http://bugs.python.org/file22538/regrtest_regex-2.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12231] regrtest: add -k and -K options to filter tests by function/file names

2011-06-04 Thread Éric Araujo

Éric Araujo  added the comment:

File name, class name, method name unless I misremember.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12231] regrtest: add -k and -K options to filter tests by function/file names

2011-06-03 Thread STINNER Victor

STINNER Victor  added the comment:

> How about reusing unittest discovery in regrtest?

Does this feature support filtering by keyword for file names and function 
names?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12231] regrtest: add -k and -K options to filter tests by function/file names

2011-06-03 Thread Éric Araujo

Éric Araujo  added the comment:

How about reusing unittest discovery in regrtest?

--
nosy: +eric.araujo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12231] regrtest: add -k and -K options to filter tests by function/file names

2011-06-01 Thread R. David Murray

R. David Murray  added the comment:

+1 to what Ezio said, though I'd rather have this than not have the 
functionality at all :)

--
nosy: +r.david.murray

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12231] regrtest: add -k and -K options to filter tests by function/file names

2011-06-01 Thread Ezio Melotti

Ezio Melotti  added the comment:

IMHO it would be better to tweak regrtest so that it understand 
test_file.TestClass.test_method, possibly supporting wildcards.
E.g.:
  - ./python -m test test_subprocess.POSIXProcessTestCase
  - ./python -m test test_subprocess.POSIXProcessTestCase.test_pass_fds
  - ./python -m test '*codecencoding*'
  - ./python -m test 'test_subprocess.C*'

The -x/--exclude option could be extended to support this notation too and make 
possible to exclude specific tests classes/methods.
Wildcards are less flexible than regex, but I think they are good enough for 
our use case and simpler to use.

--
nosy: +ezio.melotti
stage:  -> needs patch
type:  -> feature request
versions:  -Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12231] regrtest: add -k and -K options to filter tests by function/file names

2011-05-31 Thread STINNER Victor

STINNER Victor  added the comment:

> Attached patch adds -k/--func-regex and -K/--file-regex options to filter
> tests by function/file names.

We need maybe a third option to filter tests by their class name. And we need 
also maybe the opposite option: exclude tests matching a regex. Another 
proposition: --include and --exclude options using the following format:

::

Each field is optional, examples:

--include "test_subprocess::leak" ignores test_leak function of 
test_subprocess file
--include "codecencoding::" runs the 6 test_codecencoding* files
--include "test_subprocess:^C:" runs only the tests of the io module (not the 
_pyio module)
- etc.

Problem: --exclude (-x) option is already used.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12231] regrtest: add -k and -K options to filter tests by function/file names

2011-05-31 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12231] regrtest: add -k and -K options to filter tests by function/file names

2011-05-31 Thread STINNER Victor

New submission from STINNER Victor :

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

--
components: Tests
files: regrtest_regex.patch
keywords: patch
messages: 137402
nosy: haypo
priority: normal
severity: normal
status: open
title: regrtest: add -k and -K options to filter tests by function/file names
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file22216/regrtest_regex.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com