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

Documentation/errors: provide a forward-path for the --junitxml deprecation #6265

Closed
Liz4v opened this issue Nov 23, 2019 · 9 comments · Fixed by #6343
Closed

Documentation/errors: provide a forward-path for the --junitxml deprecation #6265

Liz4v opened this issue Nov 23, 2019 · 9 comments · Fixed by #6343
Labels
good first issue easy issue that is friendly to new contributor plugin: junitxml related to the junitxml builtin plugin topic: reporting related to terminal output and user-facing messages and errors

Comments

@Liz4v
Copy link

Liz4v commented Nov 23, 2019

With the deprecation of junitxml, we are only provided with a way to silence the warning, but no clear path to act on it in a way that isn't just kicking the can down the road. The deprecation warning should include a future-ready solution as well even if that's just a link to the external plugin or whatever.

@Liz4v
Copy link
Author

Liz4v commented Nov 23, 2019

Ah… I've finally figure out that the warning is because I don't have this value set at all! I guess explicitly saying so in the error message would help?

@Zac-HD Zac-HD added plugin: junitxml related to the junitxml builtin plugin topic: reporting related to terminal output and user-facing messages and errors type: docs documentation improvement, missing or needing clarification labels Nov 23, 2019
@Zac-HD
Copy link
Member

Zac-HD commented Nov 23, 2019

Looks like the warning is defined here:

JUNIT_XML_DEFAULT_FAMILY = PytestDeprecationWarning(
"The 'junit_family' default value will change to 'xunit2' in pytest 6.0.\n"
"Add 'junit_family=legacy' to your pytest.ini file to silence this warning and make your suite compatible."
)

and used here:

junit_family = config.getini("junit_family")
if not junit_family:
_issue_warning_captured(deprecated.JUNIT_XML_DEFAULT_FAMILY, config.hook, 2)
junit_family = "xunit1"

I think it would be sufficient to expand the message:

JUNIT_XML_DEFAULT_FAMILY = PytestDeprecationWarning( 
    "You have not set the 'junit_family' config value, which currently defaults to 'xunit1'.\n" 
    "The 'junit_family' default value will change to 'xunit2' in pytest 6.0.\n" 
    "Add 'junit_family=legacy' (or another value) to your pytest.ini file to "
    "silence this warning and make your suite compatible." 
) 

@Zac-HD Zac-HD added good first issue easy issue that is friendly to new contributor and removed type: docs documentation improvement, missing or needing clarification labels Nov 23, 2019
@blueyed blueyed closed this as completed Nov 27, 2019
@Zac-HD

This comment has been minimized.

@Zac-HD Zac-HD reopened this Nov 27, 2019
@blueyed

This comment has been minimized.

@fperrin
Copy link

fperrin commented Dec 13, 2019

Hi @Zac-HD ,

I think it would be sufficient to expand the message:

JUNIT_XML_DEFAULT_FAMILY = PytestDeprecationWarning( 
    "You have not set the 'junit_family' config value, which currently defaults to 'xunit1'.\n" 
    "The 'junit_family' default value will change to 'xunit2' in pytest 6.0.\n" 
    "Add 'junit_family=legacy' (or another value) to your pytest.ini file to "
    "silence this warning and make your suite compatible." 
) 

I'm not sure I follow the meaning of the message. What does "legacy (or another value)" mean? Shouldn't the recommendation be to explicitly set the current default? Ie. the last sentence whould read : « Add 'junit_family=xunit1' to your pytest.ini file to keep the current format in future versions of pytest and silence this warning ».

@nicoddemus
Copy link
Member

@fperrin I agree 👍

@Zac-HD
Copy link
Member

Zac-HD commented Dec 13, 2019

Also agree, I'd just made the minimal edit without thinking too much 😅

@nicoddemus
Copy link
Member

Thanks everyone: #6343 👍

@fperrin
Copy link

fperrin commented Dec 13, 2019

Thanks @nicoddemus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue easy issue that is friendly to new contributor plugin: junitxml related to the junitxml builtin plugin topic: reporting related to terminal output and user-facing messages and errors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants