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

Method test_setgroups_hack_OSError

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

Source from the content-addressed store, hash-verified

922
923 @patch('os.setgroups', create=True)
924 def test_setgroups_hack_OSError(self, setgroups):
925 exc = OSError()
926 exc.errno = errno.EINVAL
927
928 def on_setgroups(groups):
929 if len(groups) <= 200:
930 setgroups.return_value = True
931 return
932 raise exc
933
934 setgroups.side_effect = on_setgroups
935
936 _setgroups_hack(list(range(400)))
937
938 setgroups.side_effect = exc
939 with pytest.raises(OSError):
940 _setgroups_hack(list(range(400)))
941
942 exc2 = OSError()
943 exc.errno = errno.ESRCH
944 setgroups.side_effect = exc2
945 with pytest.raises(OSError):
946 _setgroups_hack(list(range(400)))
947
948 @t.skip.if_win32
949 @patch('celery.platforms._setgroups_hack')

Callers

nothing calls this directly

Calls 2

_setgroups_hackFunction · 0.90
raisesMethod · 0.80

Tested by

no test coverage detected