10000 Update references to mock in PR tests · becerratello/github3.py@762ad57 · GitHub
[go: up one dir, main page]

Skip to content

Commit 762ad57

Browse files
committed
Update references to mock i 8000 n PR tests
1 parent 1886cf3 commit 762ad57

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

tests/test_pulls.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
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
73

84

95
class 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')

0 commit comments

Comments
 (0)
0