packages/python/python-schema/python-schema-0.7.5-mock.patch

27 lines
738 B
Diff

From 3baf0c3595ab7bb70f920968400947c117d1564d Mon Sep 17 00:00:00 2001
From: Jelle van der Waa <jelle@vdwaa.nl>
Date: Wed, 8 Nov 2023 10:07:25 +0100
Subject: [PATCH] Make mock test dependency optional for Python > 3.3
Since Python 3.3 unittest.mock is available as a build in module.
---
test_schema.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/test_schema.py b/test_schema.py
index 370298a..0dbaf88 100644
--- a/test_schema.py
+++ b/test_schema.py
@@ -10,7 +10,10 @@
from functools import partial
from operator import methodcaller
-from mock import Mock
+try:
+ from unittest.mock import Mock
+except ImportError:
+ from mock import Mock
from pytest import mark, raises
from schema import (