Tests are not executed when using --dead-fixtures
See original GitHub issueAs I have already mentioned in https://github.com/jllorencetti/pytest-deadfixtures/issues/16#issuecomment-385154686 this plugin breaks the test count in the output.
How it is now
It seams that this plugin breaks something related with the tests count. As we can clearly see that 16 tests were collected, but no tests ran.
============================= test session starts ==============================
platform linux -- Python 3.6.5, pytest-3.5.1, py-1.5.3, pluggy-0.6.0
rootdir: /home/travis/build/wemake-services/wemake-django-template, inifile: setup.cfg
plugins: isort-0.1.0, flake8-1.0.0, deadfixtures-2.0.1, cookies-0.3.0
collected 16 items
Cool, every declared fixture is being used.
========================= no tests ran in 0.02 seconds =========================
The command "pipenv run python -m pytest" exited with 0.
Link to the build: https://travis-ci.org/wemake-services/wemake-django-template/builds/372351651
How it should be
============================= test session starts ==============================
platform linux -- Python 3.6.5, pytest-3.5.1, py-1.5.3, pluggy-0.6.0
rootdir: /home/travis/build/wemake-services/wemake-django-template, inifile: setup.cfg
plugins: isort-0.1.0, flake8-1.0.0, deadfixtures-2.0.0, cookies-0.3.0
collected 16 items
Cool, every declared fixture is being used.
....
========================= 4 tests ran in 0.02 seconds =========================
The command "pipenv run python -m pytest" exited with 0.
Env
Here’re my exact versions:
python
:3.6.5
,pytest
:==3.5.1
pytest-deadfixtures
:==2.0.1
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
pytest-deadfixtures - PyPI
A simple plugin to list unused or duplicated fixtures in a pytest suite. Features. List unused fixtures in your tests. List duplicated fixtures ......
Read more >Test is not executed when pytest.fixture is used - Stack Overflow
First of all, pytest.fixture is a decorator, so it is affecting the function below, and the right way to use it is to...
Read more >pytest-deadfixtures - Bountysource
I have a python app with the following folder structure: ├── src └── tests ... When I run pytest --dead-fixtures tests/application/ I get...
Read more >Testing Python Applications with Pytest
pytest --picked will collect all test modules that were newly created or changed but not yet committed in a Git repository and run...
Read more >pytest Documentation - Read the Docs
Execute the test function with “quiet” reporting mode: ... By default, pytest will not show test durations that are too small (<0.005s) ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
So, can I make this change?
I see it to be like this:
--dead-fixtures
tests are collected and executed as usual--dup-fixtures
tests are collected and executed as usualI guess 2 and 4 should be executed as soon as possible, so we don’t have to waste users time on actually running any tests.
@jllorencetti what do you think?
@sobolevn when I first created the plugin I wasn’t expecting it to be used for other people so I made it fit my particular workflow. Makes sense to leave this issue open, but I won’t be able to take a look at it right now, so I’ll at a note about this behavior in the docs.