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

Some warnings are not captured by pytest #33

Closed
m-mohr opened this issue Jan 22, 2024 · 2 comments
Closed

Some warnings are not captured by pytest #33

m-mohr opened this issue Jan 22, 2024 · 2 comments

Comments

@m-mohr
Copy link
Member

m-mohr commented Jan 22, 2024

Some warnings are not correctly captured by pytest after the changes in #27.

Instead of showing up in the warnings summary:
grafik

They now show up in the live log setup:
grafik

That is confusing. They are also not identified as warnings by pytest. Is there a way to fix this, @soxofaan ?

Originally posted by @m-mohr in #32 (comment)

Code to run this: pytest src/openeo_test_suite/tests/processes/processing/test_example.py --runner=dask --log-cli-level=WARN --processes divide,array_append > output.txt

@soxofaan
Copy link
Member

I'm just going to revert this warning to warnings.warn if that makes more sense to you.
This is warning is basically a todo that has to be addressed anyway, it's not worth it to overthink if this has to be logging.warning vs warnings.warn

@soxofaan
Copy link
Member

one minor thing: I changed the warning message from ...but got {result.__class__} to ...but got {result!r} because the latter gives more information and context (exception class + message) instead of just exception class

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

No branches or pull requests

2 participants