pythonunit-testingpytest

List available tests with py.test


I can't find a way to list the tests which I can call with py.test -k PATTERN

How can I see the list of the available tests?


Solution

  • You can also use --collect-only, this will show a tree-like structure of the collected nodes. Usually one can simply -k on the names of the Function nodes.