esmf-org / esmf

The Earth System Modeling Framework (ESMF) is a suite of software tools for developing high-performance, multi-component Earth science modeling applications.
https://earthsystemmodeling.org/
Other
156 stars 75 forks source link

Change ESMPy xfails to expected exception tests #265

Open billsacks opened 2 months ago

billsacks commented 2 months ago

I noticed that at least some of the xfails we have in ESMPy testing are tests that exceptions are caught appropriately - e.g., test_interfaceint2 in test_cbindings.py:

https://github.com/esmf-org/esmf/blob/7e6ffb30d33b7e87faa3d98c2adc2efa33b4b68f/src/addon/esmpy/src/esmpy/test/test_cbindings.py#L37-L45

I haven't looked closely, but I think these could / should be converted to expected exception handling - e.g., see https://pytest-with-eric.com/introduction/pytest-assert-exception/

Benefits would be:

(1) The test results would be cleaner: I think of xfails as being tests that are currently not working right that we want to fix eventually, and a completely clean test result wouldn't have any xfails.

(2) We could ensure that the correct exception is being raised.