Open taliaga opened 9 years ago
I think a nice fit would be to create a new command line switch which outputs the collection tree similar to what you see with --collection-only
, but annotated with all the fixtures that are enabled for each item as discovered during collection (including autouse
fixtures, which seems to be the main use case mentioned by @taliaga):
<Module 'testing/python/raises.py'>
<Class 'TestRaises'>
<Instance '()'>
<Function 'test_raises'> fixtures: testdir
<Function 'test_raises_exec'> fixtures: testdir
<Function 'test_raises_syntax_error'> fixtures: testdir
<Function 'test_raises_function'> fixtures: testdir
<Function 'test_raises_callable_no_exception'> fixtures: testdir
<Function 'test_raises_flip_builtin_AssertionError'> fixtures: testdir
<Function 'test_raises_as_contextmanager'> fixtures: testdir
<Function 'test_noclass'> fixtures: testdir
<Function 'test_tuple'> fixtures: testdir
Possibly with different colors for normal fixtures and autouse fixtures.
@nicoddemus maybe #3 kind of answer this one ?
Moved from https://github.com/pytest-dev/pytest/issues/901.