File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import 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
73
84
95class TestPullRequest (BaseCase ):
@@ -41,7 +37,7 @@ def test_close(self):
4137
4238 self .login ()
4339
44- with patch .object (github3 .pulls .PullRequest , 'update' ) as up :
40+ with mock . patch .object (github3 .pulls .PullRequest , 'update' ) as up :
4541 up .return_value = True
4642 assert self .pull .close ()
4743 up .assert_called_once_with (
@@ -136,7 +132,7 @@ def test_reopen(self):
136132 self .assertRaises (github3 .GitHubError , self .pull .reopen )
137133
138134 self .login ()
139- with patch .object (github3 .pulls .PullRequest , 'update' ) as up :
135+ with mock . patch .object (github3 .pulls .PullRequest , 'update' ) as up :
140136 self .pull .reopen ()
141137 up .assert_called_once_with (
142138 self .pull .title , self .pull .body , 'open' )
You can’t perform that action at this time.
0 commit comments