From f076795ad990afe181ae6b2eef1b8725e4fadfee Mon Sep 17 00:00:00 2001 From: AlexNg Date: Sat, 16 Mar 2024 21:28:18 +0800 Subject: [PATCH] test: Add test for 0 --- tests/test_dataframe_compatibility.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/test_dataframe_compatibility.py b/tests/test_dataframe_compatibility.py index d106a18..3df2b6e 100644 --- a/tests/test_dataframe_compatibility.py +++ b/tests/test_dataframe_compatibility.py @@ -77,7 +77,7 @@ def test_LO_init_missingGetValueError_lengthFunc() -> None: ) -def test_LO_init_invalidLengthValueError() -> None: +def test_LO_init_invalidLengthValueError_negative() -> None: with pytest.raises(ValueError): ParallelProcessing( function=lambda x: x, @@ -86,6 +86,15 @@ def test_LO_init_invalidLengthValueError() -> None: ) +def test_LO_init_invalidLengthValueError_zero() -> None: + with pytest.raises(AssertionError): + ParallelProcessing( + function=lambda x: x, + dataset=DummyLengthOnly(0), + _get_value=lambda *_: _, + ) + + def test_LO_init_nonIntLengthError_numLike() -> None: with pytest.raises(TypeError): ParallelProcessing(