summaryrefslogtreecommitdiff
blob: 11cf4ca70cf6b19bb5e8585a6bb4396d31697421 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
From 12c2e06a88832fa208c9c0361e5ce91436a5d5ac Mon Sep 17 00:00:00 2001
From: Tim Harder <radhermit@gmail.com>
Date: Thu, 27 Dec 2018 01:42:45 -0600
Subject: [PATCH] Use mock from unittest for python3.

---
 aniso8601/tests/test_builder.py  | 5 ++++-
 aniso8601/tests/test_date.py     | 5 ++++-
 aniso8601/tests/test_duration.py | 5 ++++-
 aniso8601/tests/test_interval.py | 5 ++++-
 aniso8601/tests/test_time.py     | 5 ++++-
 aniso8601/tests/test_timezone.py | 5 ++++-
 6 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/aniso8601/tests/test_builder.py b/aniso8601/tests/test_builder.py
index 453f781..aafc7fe 100644
--- a/aniso8601/tests/test_builder.py
+++ b/aniso8601/tests/test_builder.py
@@ -9,7 +9,10 @@
 import datetime
 import pickle
 import unittest
-import mock
+try:
+    from unittest import mock
+except ImportError:
+    import mock
 import aniso8601
 import dateutil.relativedelta
 
diff --git a/aniso8601/tests/test_date.py b/aniso8601/tests/test_date.py
index 2c60245..a991be1 100644
--- a/aniso8601/tests/test_date.py
+++ b/aniso8601/tests/test_date.py
@@ -7,7 +7,10 @@
 # of the BSD license.  See the LICENSE file for details.
 
 import unittest
-import mock
+try:
+    from unittest import mock
+except ImportError:
+    import mock
 import aniso8601
 
 from aniso8601.exceptions import ISOFormatError
diff --git a/aniso8601/tests/test_duration.py b/aniso8601/tests/test_duration.py
index ed8383f..b835e1b 100644
--- a/aniso8601/tests/test_duration.py
+++ b/aniso8601/tests/test_duration.py
@@ -7,7 +7,10 @@
 # of the BSD license.  See the LICENSE file for details.
 
 import unittest
-import mock
+try:
+    from unittest import mock
+except ImportError:
+    import mock
 import aniso8601
 
 from aniso8601.exceptions import ISOFormatError, NegativeDurationError
diff --git a/aniso8601/tests/test_interval.py b/aniso8601/tests/test_interval.py
index d05909d..d14045d 100644
--- a/aniso8601/tests/test_interval.py
+++ b/aniso8601/tests/test_interval.py
@@ -7,7 +7,10 @@
 # of the BSD license.  See the LICENSE file for details.
 
 import unittest
-import mock
+try:
+    from unittest import mock
+except ImportError:
+    import mock
 import aniso8601
 
 from aniso8601.exceptions import ISOFormatError
diff --git a/aniso8601/tests/test_time.py b/aniso8601/tests/test_time.py
index 6cca13d..bade083 100644
--- a/aniso8601/tests/test_time.py
+++ b/aniso8601/tests/test_time.py
@@ -7,7 +7,10 @@
 # of the BSD license.  See the LICENSE file for details.
 
 import unittest
-import mock
+try:
+    from unittest import mock
+except ImportError:
+    import mock
 import aniso8601
 
 from aniso8601.resolution import TimeResolution
diff --git a/aniso8601/tests/test_timezone.py b/aniso8601/tests/test_timezone.py
index 77903cb..1f43052 100644
--- a/aniso8601/tests/test_timezone.py
+++ b/aniso8601/tests/test_timezone.py
@@ -7,7 +7,10 @@
 # of the BSD license.  See the LICENSE file for details.
 
 import unittest
-import mock
+try:
+    from unittest import mock
+except ImportError:
+    import mock
 import aniso8601
 
 from aniso8601.exceptions import ISOFormatError
-- 
2.20.1