-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Currently the span name for parametrized tests include the attributes. This means that the spans are different and won't be grouped in views like the flamegraph.
Using the test file below
import time
from collections.abc import Iterator
import pytest
@pytest.fixture(scope="session", autouse=True)
def session_fixture() -> Iterator[None]:
time.sleep(2)
yield
time.sleep(2)
@pytest.fixture(scope="module", autouse=True)
def module_fixture() -> Iterator[None]:
time.sleep(1)
yield
time.sleep(1)
@pytest.fixture
def function_fixture() -> Iterator[None]:
time.sleep(0.5)
yield
time.sleep(0.5)
@pytest.mark.parametrize("header", ["without bearer", "bearer ", "bearer not_found"])
def test_parametrized(header: str, function_fixture: None) -> None:
assert header
time.sleep(1)
We can see that the tree tests have different span names and are not grouped
However, it would be useful to have the same span name so that one can know the total time that specific test is taking.
Metadata
Metadata
Assignees
Labels
No labels