| |
@@ -0,0 +1,39 @@
|
| |
+ From 9fe089a2ae88dabd17d74e24e2af42725f5b91c4 Mon Sep 17 00:00:00 2001
|
| |
+ From: Kurt Mosiejczuk <kurt@cranky.work>
|
| |
+ Date: Fri, 13 Sep 2019 18:51:33 -0400
|
| |
+ Subject: [PATCH] Use built-in mock from unittest when available (Python 3.4+)
|
| |
+
|
| |
+ ---
|
| |
+ setup.py | 2 +-
|
| |
+ tests/time.py | 5 ++++-
|
| |
+ 2 files changed, 5 insertions(+), 2 deletions(-)
|
| |
+
|
| |
+ diff --git a/setup.py b/setup.py
|
| |
+ index 327388d..7638ec5 100644
|
| |
+ --- a/setup.py
|
| |
+ +++ b/setup.py
|
| |
+ @@ -36,7 +36,7 @@
|
| |
+ include_package_data=True,
|
| |
+ zip_safe=False,
|
| |
+ test_suite="tests",
|
| |
+ - tests_require=['mock'],
|
| |
+ + tests_require=['mock;python_version<"3.4"'],
|
| |
+ install_requires=[
|
| |
+ # -*- Extra requirements: -*-
|
| |
+ ],
|
| |
+ diff --git a/tests/time.py b/tests/time.py
|
| |
+ index 7747c87..3068d0d 100644
|
| |
+ --- a/tests/time.py
|
| |
+ +++ b/tests/time.py
|
| |
+ @@ -3,7 +3,10 @@
|
| |
+
|
| |
+ """Tests for time humanizing."""
|
| |
+
|
| |
+ -from mock import patch
|
| |
+ +try:
|
| |
+ + from unittest.mock import patch
|
| |
+ +except (ImportError, AttributeError):
|
| |
+ + from mock import patch
|
| |
+
|
| |
+ from humanize import time
|
| |
+ from datetime import date, datetime, timedelta
|
| |