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

Changing an id of a pytest parameter set breaks test's history #744

Closed
1 of 3 tasks
delatrie opened this issue Apr 22, 2023 · 0 comments · Fixed by #745
Closed
1 of 3 tasks

Changing an id of a pytest parameter set breaks test's history #744

delatrie opened this issue Apr 22, 2023 · 0 comments · Fixed by #745
Assignees
Labels
bug Something isn't working theme:pytest

Comments

@delatrie
Copy link
Contributor

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

Assigning or changing an id of a parameter set in pytest's parametrize mark breaks the test's run/rerun history.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

Given we have the following test file:

import pytest

@pytest.mark.parametrize("v", [1])
def test_issue744_reproduction(v):
    pass

When we run pytest (without the --clean-alluredir argument), and then assign ids to the parameter sets:

import pytest

@pytest.mark.parametrize("v", [1], ids=["a"])
def test_issue744_reproduction(v):
    pass

When we run pytest again we end up with two test results with different historyId values.

If we generate the report it will look like this:

What is the expected behavior?

Both results should be considered retries (i.e., should have the same 'historyId' values). Assigning an id to a parameter set should only affects the default title of the test (where a portion of the nodeid is used).

What is the motivation / use case for changing the behavior?

More flexibility to refactor tests without losing the history of runs/reruns.

Please tell us about your environment:

  • Allure version: 2.20.1
  • Test framework: pytest@7.2.0
  • Allure adaptor: allure-pytest@2.13.1

Other information

Most probably will be fixed together with #743.

@delatrie delatrie added bug Something isn't working theme:pytest labels Apr 22, 2023
@delatrie delatrie self-assigned this Apr 22, 2023
@delatrie delatrie changed the title Changing a pytest parameter set id breaks test's history Changing an id of a pytest parameter set breaks test's history Apr 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working theme:pytest
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant