8000 Meant 0.3 in last commit message. · n1k0/github3.py@bfb392e · GitHub 8000
[go: up one dir, main page]

Skip to content

Commit bfb392e

Browse files
committed
Meant 0.3 in last commit message.
Fixed tests. Mock's docs are out of date a bit. contextlib deprecated nested() and nested with statements are the only things that make sense it seems.
1 parent a21ded0 commit bfb392e

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

tests/test_github.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import github3
22
from mock import patch
3-
from contextlib import nested
43
from tests.utils import (generate_response, expect, BaseCase, load)
54

65

@@ -577,14 +576,14 @@ def test_update_user(self):
577576
args = ('Ian Cordasco', 'example@mail.com', 'www.blog.com', 'company',
578577
'loc', True, 'bio')
579578

580-
with nested(patch.object(github3.github.GitHub, 'user'),
581-
patch.object(github3.users.User, 'update')) as (user, upd):
582-
user.return_value = github3.users.User(load('user'), self.g)
583-
upd.return_value = True
584-
expect(self.g.update_user(*args)).is_True()
585-
expect(user.called).is_True()
586-
expect(upd.called).is_True()
587-
upd.assert_called_with(*args)
579+
with patch.object(github3.github.GitHub, 'user') as user:
580+
with patch.object(github3.users.User, 'update') as upd:
581+
user.return_value = github3.users.User(load('user'), self.g)
582+
upd.return_value = True
583+
expect(self.g.update_user(*args)).is_True()
584+
expect(user.called).is_True()
585+
expect(upd.called).is_True()
586+
upd.assert_called_with(*args)
588587

589588
def test_user(self):
590589
self.request.return_value = generate_response('user')

0 commit comments

Comments
 (0)
0