diff --git a/Makefile b/Makefile index ef04308..cf1c189 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ install: ## install to site-packages test: ## run the python unit tests python -m pytest -v ccflow/tests --cov=ccflow --cov-report xml --cov-report term-missing -test: tests +tests: test ########### # Linting # diff --git a/ccflow/tests/result/test_generic.py b/ccflow/tests/result/test_generic.py index af8c2b4..129ddf8 100644 --- a/ccflow/tests/result/test_generic.py +++ b/ccflow/tests/result/test_generic.py @@ -38,4 +38,4 @@ def test_generics_conversion(self): self.assertEqual(GenericResult[int](value=GenericContext[str](value=v)), GenericResult[int](value=v)) self.assertEqual(GenericResult[int](value=GenericContext[int](value=v)), GenericResult[int](value=v)) - self.assertEqual(GenericResult[str].validate(GenericContext(value=5)), GenericResult[str](value="5")) + self.assertEqual(GenericResult[str].model_validate(GenericContext(value=5)), GenericResult[str](value="5")) diff --git a/ccflow/tests/test_base_serialize.py b/ccflow/tests/test_base_serialize.py index f68485c..3065bb6 100644 --- a/ccflow/tests/test_base_serialize.py +++ b/ccflow/tests/test_base_serialize.py @@ -164,12 +164,8 @@ def test_numpy_serialize(self): self._check_serialization(H(arr=[1, 0]), self._numpy_equality) self._check_serialization(F(arr=["passes"]), self._numpy_equality) - self.assertRaises( - Exception, - self._check_serialization, - H_complex64(arr=[11, 12]), - self._numpy_equality, - ) + + self._check_serialization(H_complex64(arr=[11, 12]), self._numpy_equality) cut_off_array = H_int8(arr=[127, -128]) np.testing.assert_array_equal(cut_off_array.arr, np.array([127, -128], dtype=np.int8)) diff --git a/ccflow/tests/test_lazy_result.py b/ccflow/tests/test_lazy_result.py index 7f78e43..eecd03f 100644 --- a/ccflow/tests/test_lazy_result.py +++ b/ccflow/tests/test_lazy_result.py @@ -15,6 +15,7 @@ class MyResult(ResultBase): def _validate(self): # Track construction by incrementing the total each time the validation is called MyResult.total += 1 + return self def test_make_lazy_result(): diff --git a/ccflow/tests/utils/test_chunker.py b/ccflow/tests/utils/test_chunker.py index a10e59b..656c705 100644 --- a/ccflow/tests/utils/test_chunker.py +++ b/ccflow/tests/utils/test_chunker.py @@ -6,13 +6,13 @@ class TestChunker(unittest.TestCase): def test_dates_to_chunks_M(self): - out = dates_to_chunks(date(2022, 4, 6), date(2022, 4, 7), "M") + out = dates_to_chunks(date(2022, 4, 6), date(2022, 4, 7), "ME") self.assertListEqual(out, [(date(2022, 4, 1), date(2022, 4, 30))]) - out = dates_to_chunks(date(2022, 4, 1), date(2022, 4, 30), "M") + out = dates_to_chunks(date(2022, 4, 1), date(2022, 4, 30), "ME") self.assertListEqual(out, [(date(2022, 4, 1), date(2022, 4, 30))]) - out = dates_to_chunks(date(2022, 3, 6), date(2022, 4, 7), "M") + out = dates_to_chunks(date(2022, 3, 6), date(2022, 4, 7), "ME") self.assertListEqual( out, [ @@ -20,7 +20,7 @@ def test_dates_to_chunks_M(self): (date(2022, 4, 1), date(2022, 4, 30)), ], ) - out = dates_to_chunks(date(2022, 1, 6), date(2022, 4, 7), "M") + out = dates_to_chunks(date(2022, 1, 6), date(2022, 4, 7), "ME") self.assertListEqual( out, [ @@ -65,13 +65,13 @@ def test_dates_to_chunks_d(self): self.assertListEqual(out, []) def test_dates_to_chunks_trim(self): - out = dates_to_chunks(date(2022, 4, 6), date(2022, 4, 7), "M", trim=True) + out = dates_to_chunks(date(2022, 4, 6), date(2022, 4, 7), "ME", trim=True) self.assertListEqual(out, [(date(2022, 4, 6), date(2022, 4, 7))]) - out = dates_to_chunks(date(2022, 4, 1), date(2022, 4, 30), "M", trim=True) + out = dates_to_chunks(date(2022, 4, 1), date(2022, 4, 30), "ME", trim=True) self.assertListEqual(out, [(date(2022, 4, 1), date(2022, 4, 30))]) - out = dates_to_chunks(date(2022, 3, 6), date(2022, 4, 7), "M", trim=True) + out = dates_to_chunks(date(2022, 3, 6), date(2022, 4, 7), "ME", trim=True) self.assertListEqual( out, [ @@ -79,7 +79,7 @@ def test_dates_to_chunks_trim(self): (date(2022, 4, 1), date(2022, 4, 7)), ], ) - out = dates_to_chunks(date(2022, 1, 6), date(2022, 4, 7), "M", trim=True) + out = dates_to_chunks(date(2022, 1, 6), date(2022, 4, 7), "ME", trim=True) self.assertListEqual( out, [