nvim-neotest / neotest-python

MIT License
115 stars 34 forks source link

feat(pytest): prefix diagnostic messages with parameterized test ID #33

Closed OddBloke closed 1 year ago

OddBloke commented 1 year ago

Given a test like:

@pytest.mark.parametrize("a,b", [("b", "c"), ("c", "d")])
def test_a(a, b):
    assert False

This modifies the diagnostic message from:

neotest: assert False
neotest: assert False

to:


neotest: [b-c] assert False
neotest: [c-d] assert False

This is the same internal value which pytest uses for parametrized instances in its output, so it should be fully consistent.

Without this, the diagnostic messages aren't very useful for parametrized tests: you can't identify which of the multiple test which execute the given line are failing.

Fixes: #30

rcarriga commented 1 year ago

Love this thanks!