8000 Only import mock in tests/utils.py · jim-minter/github3.py@f04cc80 · GitHub
[go: up one dir, main page]

Skip to content

Commit f04cc80

Browse files
committed
Only import mock in tests/utils.py
1 parent 4c9a643 commit f04cc80

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/utils.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99

1010
import requests
1111
import github3
12+
1213
try:
13-
from unittest.mock import patch
14+
from unittest import mock
1415
except ImportError:
15-
from mock import patch
16+
import mock
17+
1618
from io import BytesIO
1719
from requests.structures import CaseInsensitiveDict
1820

@@ -39,7 +41,7 @@ def setUp(self):
3941
self.g.login(token=os.environ['GH_AUTH'])
4042
self.args = ()
4143
self.conf = {'allow_redirects': True}
42-
self.mock = patch.object(requests.sessions.Session, 'request')
44+
self.mock = mock.patch.object(requests.sessions.Session, 'request')
4345
self.request = self.mock.start()
4446

4547
def tearDown(self):

0 commit comments

Comments
 (0)
0