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.
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