Skip to content

Unreachable code was marked as covered #24169

@bpasero

Description

@bpasero

Testing #24156

I had this test:

@pytest.mark.parametrize("num", range(1, 10))
def test_num(num):
    if False:
        time.sleep(0.3)
        assert True
    time.sleep(0.3)
    assert True

And ran the tests (from the https://github.com/eleanorjboyd/inc_dec_example_repo/blob/main/inc_dec_example_test_suite/test_unit_and_pytest_combo.py repo) and the branch was colored as covered:

Image

Metadata

Metadata

Assignees

Labels

area-testingbugIssue identified by VS Code Team member as probable bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions