From 82c2599585a6119e5afd26e58e754972c79f6734 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Wed, 10 Jan 2024 13:31:09 -0500 Subject: [PATCH] tests: drop dependency on external mock module for newer python (#574) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #541 Co-authored-by: Ɓukasz Langa --- html5lib/tests/test_meta.py | 5 ++++- requirements-test.txt | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/html5lib/tests/test_meta.py b/html5lib/tests/test_meta.py index dd02dd7f..e02268aa 100644 --- a/html5lib/tests/test_meta.py +++ b/html5lib/tests/test_meta.py @@ -1,7 +1,10 @@ from __future__ import absolute_import, division, unicode_literals import six -from mock import Mock +try: + from unittest.mock import Mock +except ImportError: + from mock import Mock from . import support diff --git a/requirements-test.txt b/requirements-test.txt index 39913ee4..aca31f5e 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -6,6 +6,5 @@ pytest>=4.6.10,<5 ; python_version < '3' pytest>=5.4.2,<8 ; python_version >= '3' coverage>=5.1,<6 pytest-expect>=1.1.0,<2 -mock>=3.0.5,<4 ; python_version < '3.6' -mock>=4.0.2,<5 ; python_version >= '3.6' +mock>=3.0.5,<4 ; python_version < '3.3' setuptools; python_version >= '3.12'