Skip to content

Commit

Permalink
✨ Add unittest.mock backport
Browse files Browse the repository at this point in the history
- To allow usage of `unittest.mock` in packages that import pyutilib.th as unittest
  • Loading branch information
ruaridhw committed Apr 27, 2020
1 parent 6f02a99 commit ceada22
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pyutilib/th/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,17 @@
import pyutilib.th.nose_timeout
except ImportError:
pass


mock_available = False
try:
from unittest import mock

mock_available = True
except ImportError:
try:
import mock

mock_available = True
except ImportError:
pass

0 comments on commit ceada22

Please sign in to comment.