openpipelines-bio / openpipeline

https://openpipelines.bio
MIT License
25 stars 11 forks source link

CI: Do checks on error messages after closing the context manager blocks. #710

Closed DriesSchaumont closed 2 months ago

DriesSchaumont commented 2 months ago

According to the pytest documentation: https://docs.pytest.org/en/latest/reference/reference.html#pytest.raises

When using pytest.raises as a context manager, it’s worthwhile to note that normal context manager rules apply and that the exception raised must be the final line in the scope of the context manager. Lines of code after that, within the scope of the context manager will not be executed.

There are several locations in the tests where we do this incorrectly: e.g.: https://github.com/openpipelines-bio/openpipeline/blob/509744044bf75ee92196e3d4b63ab66886d32f1b/src/dataflow/concatenate_h5mu/test.py#L130