New issue 764: --fixtures doesn't display all fixtures from conftest.py in sub 
directories
https://bitbucket.org/pytest-dev/pytest/issue/764/fixtures-doesnt-display-all-fixtures-from

Tom V:

Sample project to reproduce:
https://github.com/tomviner/bug-report-pytest-fixtures-list

Given I have a project with two app folders. Both apps have test folders with a 
conftest.py that both define a fixture. Also both apps have test files that use 
the respective app's fixture.

i.e.:
```
(pytest-fixture-find)~/dev/pytest-fixture-find$ find -name conftest.py
./project/app1/tests/conftest.py
./project/app2/tests/conftest.py

(pytest-fixture-find)~/dev/pytest-fixture-find$ ack-grep --py --context 1 "def 
fix"
project/app1/tests/conftest.py
3-@pytest.fixture
4:def fixy1():
5-    pass

project/app2/tests/conftest.py
3-@pytest.fixture
4:def fixy2():
5-    pass
```

Yet when I run `py.test --fixtures` or `py.test --fixtures --traceconfig` I 
only see one of those fixtures:
```
$ py.test --fixtures --traceconfig
PLUGIN registered: <_pytest.python.FixtureManager instance at 0x7f2af6b43440>
=============== test session starts ===============
platform linux2 -- Python 2.7.8 -- py-1.4.28 -- pytest-2.7.1
using: pytest-2.7.1 pylib-1.4.28

...

rootdir: /home/me/dev/pytest-fixture-find, inifile:
PLUGIN registered: <module 'conftest' from 
'/home/me/dev/pytest-fixture-find/project/app1/tests/conftest.pyc'>
PLUGIN registered: <module 'conftest' from 
'/home/me/dev/pytest-fixture-find/project/app2/tests/conftest.pyc'>
collected 2 items

...

------------- fixtures defined from conftest --------------
fixy1
    project/app1/tests/conftest.py:4: no docstring available

================  in 0.01 seconds ============={}
```

`fixy2` is not shown.

See https://github.com/tomviner/bug-report-pytest-fixtures-list for full output.


_______________________________________________
pytest-commit mailing list
pytest-commit@python.org
https://mail.python.org/mailman/listinfo/pytest-commit

Reply via email to