Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make explicit which fixtures a test use #2

Open
taliaga opened this issue Aug 4, 2015 · 2 comments
Open

Make explicit which fixtures a test use #2

taliaga opened this issue Aug 4, 2015 · 2 comments

Comments

@taliaga
Copy link

taliaga commented Aug 4, 2015

Moved from pytest-dev/pytest#901.

@nicoddemus
Copy link
Member

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.

@fruch
Copy link
Contributor

fruch commented Dec 28, 2017

@nicoddemus maybe #3 kind of answer this one ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants