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

Method test_setgroups_raises_EPERM

t/unit/utils/test_platforms.py:979–992  ·  view source on GitHub ↗
(self, hack, getgroups)

Source from the content-addressed store, hash-verified

977 @patch('os.getgroups')
978 @patch('celery.platforms._setgroups_hack')
979 def test_setgroups_raises_EPERM(self, hack, getgroups):
980 with patch('os.sysconf') as sysconf:
981 sysconf.side_effect = ValueError()
982 eperm = OSError()
983 eperm.errno = errno.EPERM
984 hack.side_effect = eperm
985 getgroups.return_value = list(range(400))
986 setgroups(list(range(400)))
987 getgroups.assert_called_with()
988
989 getgroups.return_value = [1000]
990 with pytest.raises(OSError):
991 setgroups(list(range(400)))
992 getgroups.assert_called_with()
993
994
995fails_on_win32 = pytest.mark.xfail(

Callers

nothing calls this directly

Calls 2

setgroupsFunction · 0.90
raisesMethod · 0.80

Tested by

no test coverage detected