From d1c6434bb27ebbbd4b4daad1434457119415e62c Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 10 Mar 2022 07:37:46 +0100 Subject: [PATCH] corner case: empty set will be checked by extra test --- python/tests/test_Grid.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/tests/test_Grid.py b/python/tests/test_Grid.py index 2f9dc549e..5bdfd9e5b 100644 --- a/python/tests/test_Grid.py +++ b/python/tests/test_Grid.py @@ -348,8 +348,9 @@ class TestGrid: @pytest.mark.parametrize('invert',[True,False]) def test_vicinit_offset_invert(self,random,selection,invert): selection_inverse = set(random.material.flatten()) - set(selection) - assert random.vicinity_offset(selection=selection,invert_selection=invert) == \ - random.vicinity_offset(selection=selection_inverse,invert_selection=not invert) + assert selection_inverse == set() or \ + (random.vicinity_offset(selection=selection,invert_selection=invert) == + random.vicinity_offset(selection=selection_inverse,invert_selection=not invert)) def test_vicinity_offset_selection_empty(self,random): assert random.vicinity_offset(selection=None,invert_selection=False) == random.vicinity_offset() and \