MCPcopy Create free account
hub / github.com/celery/celery / test_setgroups_hack_ValueError

Method test_setgroups_hack_ValueError

t/unit/utils/test_platforms.py:908–921  ·  view source on GitHub ↗
(self, setgroups)

Source from the content-addressed store, hash-verified

906
907 @patch('os.setgroups', create=True)
908 def test_setgroups_hack_ValueError(self, setgroups):
909
910 def on_setgroups(groups):
911 if len(groups) <= 200:
912 setgroups.return_value = True
913 return
914 raise ValueError()
915
916 setgroups.side_effect = on_setgroups
917 _setgroups_hack(list(range(400)))
918
919 setgroups.side_effect = ValueError()
920 with pytest.raises(ValueError):
921 _setgroups_hack(list(range(400)))
922
923 @patch('os.setgroups', create=True)
924 def test_setgroups_hack_OSError(self, setgroups):

Callers

nothing calls this directly

Calls 2

_setgroups_hackFunction · 0.90
raisesMethod · 0.80

Tested by

no test coverage detected