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

--last-failed is broken for parametrized and class tests since 5.4 #6968

Closed
throwable-one opened this issue Mar 25, 2020 · 4 comments
Closed
Labels
topic: collection related to the collection phase type: bug problem that needs to be addressed type: regression indicates a problem that was introduced in a release which was working previously

Comments

@throwable-one
Copy link

throwable-one commented Mar 25, 2020

import pytest

class TestPyTest:
    def test_good(self):
        pass

    def test_bad(self):
        assert False

@pytest.mark.parametrize("good", [True, False])
def test_moderate(good):
    assert good

pytest==5.3.5
First run (pytest test_foo.py): 2 failed, 2 passed
pytest --last-failed test_foo.py: 2 failed, 2 deselected

pytest==5.4.1
First run (pytest test_foo.py): 2 failed, 2 passed
pytest --last-failed test_foo.py: 1 failed

It only reruns parametrized test, but not TestPyTest.test_bad

@Zac-HD Zac-HD added topic: collection related to the collection phase type: regression indicates a problem that was introduced in a release which was working previously labels Mar 26, 2020
@blueyed

This comment has been minimized.

@nicoddemus

This comment has been minimized.

@blueyed

This comment has been minimized.

@blueyed blueyed added the type: bug problem that needs to be addressed label Mar 27, 2020
blueyed added a commit to blueyed/pytest that referenced this issue Apr 2, 2020
Only filter with known failures, and explicitly keep paths of passed
arguments.

This also displays the "run-last-failure" status before collected files,
and does not update the cache with "--collect-only".

Fixes pytest-dev#6968.
blueyed added a commit to blueyed/pytest that referenced this issue Apr 2, 2020
Only filter with known failures, and explicitly keep paths of passed
arguments.

This also displays the "run-last-failure" status before collected files,
and does not update the cache with "--collect-only".

Fixes pytest-dev#6968.
blueyed added a commit to blueyed/pytest that referenced this issue Apr 2, 2020
Only filter with known failures, and explicitly keep paths of passed
arguments.

This also displays the "run-last-failure" status before collected files,
and does not update the cache with "--collect-only".

Fixes pytest-dev#6968.
blueyed added a commit to blueyed/pytest that referenced this issue Apr 2, 2020
Only filter with known failures, and explicitly keep paths of passed
arguments.

This also displays the "run-last-failure" status before collected files,
and does not update the cache with "--collect-only".

Fixes pytest-dev#6968.
@blueyed
Copy link
Contributor

blueyed commented Apr 2, 2020

#6991

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: collection related to the collection phase type: bug problem that needs to be addressed type: regression indicates a problem that was introduced in a release which was working previously
Projects
None yet
Development

No branches or pull requests

4 participants