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

chore(tests): Raise pytest Warnings as Errors instead #563

Merged
merged 2 commits into from
Jul 30, 2024
Merged

Conversation

ferdinandjarisch
Copy link
Contributor

Since we are doing this for our plugins, it makes sense to also check for it here.

Since we are doing this for our plugins, it makes sense to also check
for it here.
@rumpelsepp
Copy link
Member

May you try if this works for you instead? If we use the setting in the pyproject.toml then any IDE, LSP, or whatever tooling people are using has the same settings when running the tests.

https://docs.pytest.org/en/stable/how-to/capture-warnings.html#controlling-warnings

# pyproject.toml
[tool.pytest.ini_options]
filterwarnings = [
    "error",
    "ignore::UserWarning",
    # note the use of single quote below to denote "raw" strings in TOML
    'ignore:function ham\(\) is deprecated:DeprecationWarning',
]

@ferdinandjarisch
Copy link
Contributor Author

May you try if this works for you instead? If we use the setting in the pyproject.toml then any IDE, LSP, or whatever tooling people are using has the same settings when running the tests.

The example that you posted obviously does not work, but using pyproject.toml in general does.
Added a fixup commit with this approach; does that match what you had in mind?

@rumpelsepp rumpelsepp merged commit 9646335 into master Jul 30, 2024
14 checks passed
@rumpelsepp rumpelsepp deleted the pytest branch July 30, 2024 09:57
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.

2 participants