| 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 | |
| 995 | fails_on_win32 = pytest.mark.xfail( |