Skip to content

Change junit_family default to xunit2 in pytest 6 #6178

Closed

Description

@nicoddemus

In order to do that, we also need to show a warning if the user does not have junit_family configured stating that the default will change in 6.0

Activity

  1. added this to the 6.1 milestone on Nov 13, 2019
  2. added
    plugin: junitxmlrelated to the junitxml builtin plugin
    type: backward compatibilitymight present some backward compatibility issues which should be carefully noted in the changelog
    on Nov 13, 2019
  3. self-assigned this
    on Nov 13, 2019
  4. Zac-HD commented on Nov 26, 2019

    @Zac-HD
    Member

    Per #6265 (comment) we already have such a warning - that issue is just to expand and clarify the message.

  5. Zac-HD commented on Nov 27, 2019

    @Zac-HD
    Member

    @blueyed - I think it's worth keeping this open so we remember to change it in pytest 6?

  6. blueyed commented on Nov 27, 2019

    @blueyed
    Contributor

    @Zac-HD
    GitHub failed me when I only wanted to close my issues, sorry.

  7. Zac-HD commented on Nov 27, 2019

    @Zac-HD
    Member

    No worries, easily fixed 😄

  8. changed the title [-]Change junit_family default to xunit2[/-] [+]Change junit_family default to xunit2 in pytest 6[/+] on Nov 27, 2019
  9. bittner commented on Apr 26, 2020

    @bittner

    Running tests with pytest now shows the warning you mention. But it's unclear what the impact of this change is, hence what should I as a developer actually do?

    • Is it required to add the junit_family=xunit1 line to my pytest configuration?
    • Will my CI build be affected or something (aka, can I ignore this warning if I don't use Jenkins)?
    .tox/py37/lib/python3.7/site-packages/_pytest/junitxml.py:417
      <redacted>/_pytest/junitxml.py:417: PytestDeprecationWarning: The 'junit_family' default value will change to 'xunit2' in pytest 6.0.
      Add 'junit_family=xunit1' to your pytest.ini file to keep the current format in future versions of pytest and silence this warning.
        _issue_warning_captured(deprecated.JUNIT_XML_DEFAULT_FAMILY, config.hook, 2)
    
    -- Docs: https://docs.pytest.org/en/latest/warnings.html
    

    The link provided doesn't seem to have information related to the impact of the change, but rather on how warnings are handled and can be controled.

    ➜ Where can I find information about the impact that this change will have?

  10. nicoddemus commented on Apr 28, 2020

    @nicoddemus
    MemberAuthor

    Hi @bittner,

    Actually the important bit is here (emphasis mine):

    Add 'junit_family=xunit1' to your pytest.ini file to keep the current format in future versions of pytest

    So yes the answer is to add that line to your pytest.ini to avoid having your suite breaking when upgrading to pytest 6. 👍

  11. bittner commented on Apr 28, 2020

    @bittner

    I did read (and understand) that, but why should my test suite break for a jUnit output format? Note that I guess it's all about the --junitxml option. My tests won't break, will they?

    So, if they won't, what will break? What are you warning about? Should I (and others) care? What would the "upgrade path" look like?

  12. 32 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

good first issueeasy issue that is friendly to new contributorplugin: junitxmlrelated to the junitxml builtin plugintype: backward compatibilitymight present some backward compatibility issues which should be carefully noted in the changelog

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions