Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixes test for os.initroups on Py2.6

  • Loading branch information...
commit 2a72f8adad77ba7517aaed819e8a1cdfc9de485a 1 parent 2299188
@ask authored
Showing with 5 additions and 8 deletions.
  1. +5 −8 celery/tests/utilities/test_platforms.py
View
13 celery/tests/utilities/test_platforms.py
@@ -256,14 +256,11 @@ def test_parse_gid_when_nonexisting_name(self, getgrnam):
class test_initgroups(Case):
@patch("pwd.getpwuid")
- def test_with_initgroups(self, getpwuid):
- prev, os.initgroups = os.initgroups, Mock()
- try:
- getpwuid.return_value = ["user"]
- initgroups(5001, 50001)
- os.initgroups.assert_called_with("user", 50001)
- finally:
- os.initgroups = prev
+ @patch("os.initgroups", create=True)
+ def test_with_initgroups(self, initgroups_, getpwuid):
+ getpwuid.return_value = ["user"]
+ initgroups(5001, 50001)
+ initgroups_.assert_called_with("user", 50001)
@patch("celery.platforms.setgroups")
@patch("grp.getgrall")
Please sign in to comment.
Something went wrong with that request. Please try again.