From deff54aae00fc9fd3f47a7e1a814b9acf872e4e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20S=C3=BAkup?= Date: Fri, 22 Jun 2018 22:58:16 +0200 Subject: [PATCH] Try import mock, but on python 3.3+ can use also stdlib unittest.mock From Python 3.3 is mock part of python standard library in unittest namespace --- AUTHORS | 1 + testing/test_mark.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 3edfdcf85..ebdcf728e 100644 --- a/AUTHORS +++ b/AUTHORS @@ -157,6 +157,7 @@ Oleg Sushchenko Oliver Bestwalter Omar Kohl Omer Hadari +Ondřej Súkup Patrick Hayes Paweł Adamczak Pedro Algarvio diff --git a/testing/test_mark.py b/testing/test_mark.py index e2e7369dc..17349916e 100644 --- a/testing/test_mark.py +++ b/testing/test_mark.py @@ -1,7 +1,11 @@ from __future__ import absolute_import, division, print_function import os import sys -import mock + +try: + import mock +except ImportError: + import unittest.mock as mock import pytest from _pytest.mark import ( MarkGenerator as Mark,