How to exclude packages/directories from py.test?
You can use -k to filter out tests following a certain name pattern/predicate, but can you filter out tests under a certain package or directory? Didn't spot any relevant flags in the documentation but perhaps I'm missing something. Thanks.
On Wed, Sep 04, 2013 at 17:03 -0700, Yang Zhang wrote:
You can use -k to filter out tests following a certain name pattern/predicate, but can you filter out tests under a certain package or directory? Didn't spot any relevant flags in the documentation but perhaps I'm missing something. Thanks.
py.test accepts files and directories:: py.test -k "..." path/to/dir will only consider tests from that dir. holger
Right, and we do use that already, but short of programmatically generating a list of all the packages except those that I want to exclude (given a fairly sprawling codebase), I was just wondering if there was a cleaner approach—if not, consider this a feature request! On Thu, Sep 5, 2013 at 2:55 AM, holger krekel <holger@merlinux.eu> wrote:
On Wed, Sep 04, 2013 at 17:03 -0700, Yang Zhang wrote:
You can use -k to filter out tests following a certain name pattern/predicate, but can you filter out tests under a certain package or directory? Didn't spot any relevant flags in the documentation but perhaps I'm missing something. Thanks.
py.test accepts files and directories::
py.test -k "..." path/to/dir
will only consider tests from that dir.
holger
-- Yang Zhang http://yz.mit.edu/
On Thu, Sep 05, 2013 at 02:58 -0700, Yang Zhang wrote:
Right, and we do use that already, but short of programmatically generating a list of all the packages except those that I want to exclude (given a fairly sprawling codebase), I was just wondering if there was a cleaner approach—if not, consider this a feature request!
FWIW the filename is also somewhat matchable, so "py.test -k 'not somepackage'" should exclude all tests residing in a directory "somepackage". holger
On Thu, Sep 5, 2013 at 2:55 AM, holger krekel <holger@merlinux.eu> wrote:
On Wed, Sep 04, 2013 at 17:03 -0700, Yang Zhang wrote:
You can use -k to filter out tests following a certain name pattern/predicate, but can you filter out tests under a certain package or directory? Didn't spot any relevant flags in the documentation but perhaps I'm missing something. Thanks.
py.test accepts files and directories::
py.test -k "..." path/to/dir
will only consider tests from that dir.
holger
-- Yang Zhang http://yz.mit.edu/
participants (2)
-
holger krekel -
Yang Zhang