Skip to content

Commit bc61703

Browse files
authored
Merge pull request #401 from mgorny/unitest-mock
Prefer unittest.mock over external mock package
2 parents f2b5162 + 790660a commit bc61703

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,6 @@ def readall(path):
6666
"Programming Language :: Python :: Implementation :: PyPy",
6767
],
6868
zip_safe=False,
69-
tests_require=["mock", "requests-mock"],
69+
tests_require=['mock;python_version<"3.3"', "requests-mock"],
7070
test_suite="tests",
7171
)

tests/test_core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
import unittest
99

1010
try:
11-
import mock
12-
except ImportError:
1311
from unittest import mock
12+
except ImportError:
13+
import mock
1414

1515

1616
@mock.patch("oauthlib.oauth1.rfc5849.generate_timestamp")

tests/test_oauth1_session.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
from requests_oauthlib import OAuth1Session
1010

1111
try:
12-
import mock
13-
except ImportError:
1412
from unittest import mock
13+
except ImportError:
14+
import mock
1515

1616
try:
1717
import cryptography

tests/test_oauth2_session.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
from unittest import TestCase
1010

1111
try:
12-
import mock
13-
except ImportError:
1412
from unittest import mock
13+
except ImportError:
14+
import mock
1515

1616
from oauthlib.common import urlencode
1717
from oauthlib.oauth2 import TokenExpiredError, OAuth2Error

0 commit comments

Comments
 (0)