Skip to content

Re-runs break JUnit report modified with record_testsuite_property #273

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

Closed
alfechner opened this issue Aug 30, 2024 · 1 comment
Closed
Labels

Comments

@alfechner
Copy link

I need to generate a JUnit report from my test runs.

I've setup a autouse fixture, that enhances the report with the current version of my test suite using record_testsuite_property:

@pytest.fixture(scope="session", autouse=True)
def log_global_env_facts(record_testsuite_property):
    record_testsuite_property("version", __version__)

I run pytest --junitxml report.junit.xml and the resulting report would look something like this:

<?xml version="1.0" encoding="utf-8"?>
<testsuites>
    <testsuite>
        <properties>
            <property name="version" value="0.0.31" />
        </properties>
        < ... />
    </testsuite>
</testsuites>

If I configure retries using pytest --reruns 2 --junitxml report.junit.xml the properties set with record_testsuite_property are ignored and don't show up in my report.

@alfechner
Copy link
Author

Closing this because it's caused by pytest-dev/pytest#7767, not by pytest-rerunfailures.

@icemac icemac added the invalid label Sep 3, 2024
@icemac icemac closed this as not planned Won't fix, can't repro, duplicate, stale Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants