File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change 1
1
import github3
2
- try :
3
- from unittest .mock import patch
4
- except ImportError :
5
- from mock import patch
6
- from tests .utils import BaseCase , load
2
+ from tests .utils import BaseCase , load , mock
7
3
8
4
9
5
class TestPullRequest (BaseCase ):
@@ -41,7 +37,7 @@ def test_close(self):
41
37
42
38
self .login ()
43
39
44
- with patch .object (github3 .pulls .PullRequest , 'update' ) as up :
40
+ with mock . patch .object (github3 .pulls .PullRequest , 'update' ) as up :
45
41
up .return_value = True
46
42
assert self .pull .close ()
47
43
up .assert_called_once_with (
@@ -136,7 +132,7 @@ def test_reopen(self):
136
132
self .assertRaises (github3 .GitHubError , self .pull .reopen )
137
133
138
134
self .login ()
139
- with patch .object (github3 .pulls .PullRequest , 'update' ) as up :
135
+ with mock . patch .object (github3 .pulls .PullRequest , 'update' ) as up :
140
136
self .pull .reopen ()
141
137
up .assert_called_once_with (
142
138
self .pull .title , self .pull .body , 'open' )
You can’t perform that action at this time.
0 commit comments