diff options
author | Daniel Hahler <git@thequod.de> | 2018-09-11 18:51:05 +0200 |
---|---|---|
committer | Daniel Hahler <git@thequod.de> | 2018-09-12 23:21:47 +0200 |
commit | 7537e94ddf6aa9efdbb448a256ab4a68f11df47c (patch) | |
tree | 1cad19dcfdb5c9e28d5caccc9559720720335f41 /testing/code | |
parent | 2c90b3db9e16a2caa1617f41cde472bc8f34d8e3 (diff) | |
download | pytest-7537e94ddf6aa9efdbb448a256ab4a68f11df47c.tar.gz |
tests: use unittest.mock with py34+
Fixes https://github.com/pytest-dev/pytest/issues/3965.
Has to work around https://github.com/tox-dev/tox/issues/706.
No coverage for pluggymaster builds is OK though anyway.
Diffstat (limited to 'testing/code')
-rw-r--r-- | testing/code/test_code.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/testing/code/test_code.py b/testing/code/test_code.py index d1ae648c8..a144bc80e 100644 --- a/testing/code/test_code.py +++ b/testing/code/test_code.py @@ -1,13 +1,19 @@ # coding: utf-8 from __future__ import absolute_import, division, print_function + import sys import _pytest._code import pytest -import mock -from test_excinfo import TWMock from six import text_type +from test_excinfo import TWMock + +try: + import mock +except ImportError: + import unittest.mock as mock + def test_ne(): code1 = _pytest._code.Code(compile('foo = "bar"', "", "exec")) |