From a66c5b2d49c50afa65b94beb05796783c754d882 Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Tue, 23 Mar 2021 06:00:47 +0800 Subject: [PATCH] Fix mock import in Python 3.x `mock` is not installed on Python 3.x according to setup.cfg: `mock; python_version<"3.0"`. Import it from stdlib to fix the ImportError. --- tests/integration/test_validators.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/integration/test_validators.py b/tests/integration/test_validators.py index 6ab8f8c..246133d 100644 --- a/tests/integration/test_validators.py +++ b/tests/integration/test_validators.py @@ -1,10 +1,14 @@ from jsonschema import ValidationError -import mock import pytest from six import u from openapi_schema_validator import OAS30Validator, oas30_format_checker +try: + from unittest import mock +except ImportError: + import mock + class TestOAS30ValidatorValidate(object):