corner case: empty set

will be checked by extra test
This commit is contained in:
Martin Diehl 2022-03-10 07:37:46 +01:00
parent 51d220dce0
commit d1c6434bb2
1 changed files with 3 additions and 2 deletions

View File

@ -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 \