(self, first, second, msg=None)
| 6 | |
| 7 | class TestCase(unittest.TestCase): |
| 8 | def assertEqual(self, first, second, msg=None) -> None: |
| 9 | try: |
| 10 | super().assertEqual(first, second, msg=msg) |
| 11 | except (ValueError, AssertionError): |
| 12 | # array-like or pandas obj |
| 13 | # convert pandas obj |
| 14 | if isinstance(first, (pd.DataFrame, pd.Series)): |
| 15 | first, second = first.values, second.values |
| 16 | |
| 17 | try: |
| 18 | np.testing.assert_equal(first, second, err_msg=msg if msg else '') |
| 19 | except AssertionError as e: |
| 20 | try: |
| 21 | np.testing.assert_allclose(first, second, rtol=1e-7, atol=1e-10, err_msg=msg if msg else '') |
| 22 | except TypeError: |
| 23 | raise e |
| 24 | |
| 25 | def assertNotEqual(self, first, second, msg=None) -> None: |
| 26 | try: |
no outgoing calls
no test coverage detected