Open-EO / openeo-test-suite

Test suite for validation of openEO back-ends against the openEO API specification
Apache License 2.0
0 stars 2 forks source link

Some warnings are not captured by pytest #33

Closed m-mohr closed 9 months ago

m-mohr commented 9 months ago

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 https://github.com/Open-EO/openeo-test-suite/issues/32#issuecomment-1903709605

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 commented 9 months ago

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 commented 9 months ago

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