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

fix #10342: put location into warning exceptions #10343

Conversation

RonnyPfannschmidt
Copy link
Member

as the warning systems own warn_explicit looses the information we add them explicitly to the warning exceptions

@The-Compiler this should resolve the issue you noted

closes #10342

as the warning systems own warn_explicit looses the information
we add them explicitly to the warning exceptions
Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose this also needs a changelog, as improvement?

@RonnyPfannschmidt
Copy link
Member Author

It's unreleased, so I consider it part of the initial change

@nicoddemus
Copy link
Member

Fair enough, did not realize that. 👍

@RonnyPfannschmidt
Copy link
Member Author

@The-Compiler i'd like to get your input before merging

@The-Compiler
Copy link
Member

I wanted to try this by installing git+https://github.com/RonnyPfannschmidt/pytest.git@fix-10342-warn-explicit-add-location, but I get:

The conflict is caused by:
    The user requested pytest 5.3.1.dev3295+g14919c4b (from git+https://github.com/RonnyPfannschmidt/pytest.git@fix-10342-warn-explicit-add-location)
    pytest-bdd 6.0.1 depends on pytest>=6.2.0

Is your branch outdated or something, or is that just a setuptools-scm thing?

@RonnyPfannschmidt
Copy link
Member Author

@The-Compiler i believe that i didn't push the tags to my repo, let me fix

@RonnyPfannschmidt
Copy link
Member Author

@The-Compiler updated

Copy link
Member

@The-Compiler The-Compiler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea with only adding it if warnings are exceptions! Only a small suggestion, but looks good to go.

src/_pytest/warning_types.py Show resolved Hide resolved
Co-authored-by: Florian Bruhin <me@the-compiler.org>
@RonnyPfannschmidt RonnyPfannschmidt merged commit 24ef7c9 into pytest-dev:main Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Old-style hookimpl warning has no location information
3 participants