Skip to content

Commit 345dda2

Browse files
committed
Merge branch 'allow-local-mock'
2 parents a1cba1d + 55d436a commit 345dda2

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

CHANGELOG.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
1.2.dev
2+
-------
3+
4+
* Try to import ``mock`` first instead of ``unittest.mock``. This gives the user flexibility
5+
to install a newer ``mock`` version from PyPI instead of using the one available in the
6+
Python distribution.
7+
Thanks `@wcooley`_ for the PR (`#54`_).
8+
9+
.. _@wcooley: https://github.com/wcooley
10+
.. _#54: https://github.com/pytest-dev/pytest-mock/issues/54
11+
112
1.1
213
---
314

pytest_mock.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import inspect
2-
import sys
32

43
import pytest
54

6-
if sys.version_info >= (3, 3): # pragma: no cover
7-
import unittest.mock as mock_module
8-
else:
5+
try:
96
import mock as mock_module
7+
except ImportError:
8+
import unittest.mock as mock_module
109

1110
version = '1.1'
1211

0 commit comments

Comments
 (0)