Package: python-oauthlib / 3.1.0-2

0001-Use-unittest.mock-instead-of-external-mock.patch Patch series | download
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
From: Daniele Tricoli <eriol@debian.org>
Date: Wed, 17 Jun 2020 01:58:02 +0200
Subject: Use unittest.mock instead of external mock
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

Backport of upstream fix made by Michał Górny.

See https://github.com/oauthlib/oauthlib/commit/d4716eb95e9590bb47381a64cda1d57bad8dd907
---
 tests/oauth1/rfc5849/endpoints/test_access_token.py                     | 2 +-
 tests/oauth1/rfc5849/endpoints/test_authorization.py                    | 2 +-
 tests/oauth1/rfc5849/endpoints/test_base.py                             | 2 +-
 tests/oauth1/rfc5849/endpoints/test_request_token.py                    | 2 +-
 tests/oauth1/rfc5849/endpoints/test_resource.py                         | 2 +-
 tests/oauth1/rfc5849/endpoints/test_signature_only.py                   | 2 +-
 tests/oauth2/rfc6749/clients/test_backend_application.py                | 2 +-
 tests/oauth2/rfc6749/clients/test_legacy_application.py                 | 2 +-
 tests/oauth2/rfc6749/clients/test_mobile_application.py                 | 2 +-
 tests/oauth2/rfc6749/clients/test_service_application.py                | 2 +-
 tests/oauth2/rfc6749/clients/test_web_application.py                    | 2 +-
 tests/oauth2/rfc6749/endpoints/test_client_authentication.py            | 2 +-
 tests/oauth2/rfc6749/endpoints/test_credentials_preservation.py         | 2 +-
 tests/oauth2/rfc6749/endpoints/test_error_responses.py                  | 2 +-
 tests/oauth2/rfc6749/endpoints/test_extra_credentials.py                | 2 +-
 tests/oauth2/rfc6749/endpoints/test_introspect_endpoint.py              | 2 +-
 tests/oauth2/rfc6749/endpoints/test_resource_owner_association.py       | 2 +-
 tests/oauth2/rfc6749/endpoints/test_revocation_endpoint.py              | 2 +-
 tests/oauth2/rfc6749/endpoints/test_scope_handling.py                   | 2 +-
 tests/oauth2/rfc6749/grant_types/test_authorization_code.py             | 2 +-
 tests/oauth2/rfc6749/grant_types/test_client_credentials.py             | 2 +-
 tests/oauth2/rfc6749/grant_types/test_implicit.py                       | 2 +-
 tests/oauth2/rfc6749/grant_types/test_refresh_token.py                  | 2 +-
 tests/oauth2/rfc6749/grant_types/test_resource_owner_password.py        | 2 +-
 tests/oauth2/rfc6749/test_parameters.py                                 | 2 +-
 tests/oauth2/rfc6749/test_server.py                                     | 2 +-
 tests/oauth2/rfc6749/test_tokens.py                                     | 2 +-
 tests/openid/connect/core/endpoints/test_claims_handling.py             | 2 +-
 .../connect/core/endpoints/test_openid_connect_params_handling.py       | 2 +-
 tests/openid/connect/core/endpoints/test_userinfo_endpoint.py           | 2 +-
 tests/openid/connect/core/grant_types/test_authorization_code.py        | 2 +-
 tests/openid/connect/core/grant_types/test_base.py                      | 2 +-
 tests/openid/connect/core/grant_types/test_dispatchers.py               | 2 +-
 tests/openid/connect/core/grant_types/test_hybrid.py                    | 2 +-
 tests/openid/connect/core/grant_types/test_implicit.py                  | 2 +-
 tests/openid/connect/core/test_server.py                                | 2 +-
 tests/openid/connect/core/test_tokens.py                                | 2 +-
 37 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/tests/oauth1/rfc5849/endpoints/test_access_token.py b/tests/oauth1/rfc5849/endpoints/test_access_token.py
index 3499fdb..bc27831 100644
--- a/tests/oauth1/rfc5849/endpoints/test_access_token.py
+++ b/tests/oauth1/rfc5849/endpoints/test_access_token.py
@@ -1,6 +1,6 @@
 from __future__ import absolute_import, unicode_literals
 
-from mock import ANY, MagicMock
+from unittest.mock import ANY, MagicMock
 
 from oauthlib.oauth1 import RequestValidator
 from oauthlib.oauth1.rfc5849 import Client
diff --git a/tests/oauth1/rfc5849/endpoints/test_authorization.py b/tests/oauth1/rfc5849/endpoints/test_authorization.py
index e9d3604..5cbebb6 100644
--- a/tests/oauth1/rfc5849/endpoints/test_authorization.py
+++ b/tests/oauth1/rfc5849/endpoints/test_authorization.py
@@ -1,6 +1,6 @@
 from __future__ import absolute_import, unicode_literals
 
-from mock import MagicMock
+from unittest.mock import MagicMock
 
 from oauthlib.oauth1 import RequestValidator
 from oauthlib.oauth1.rfc5849 import errors
diff --git a/tests/oauth1/rfc5849/endpoints/test_base.py b/tests/oauth1/rfc5849/endpoints/test_base.py
index 795ddee..24d1ffb 100644
--- a/tests/oauth1/rfc5849/endpoints/test_base.py
+++ b/tests/oauth1/rfc5849/endpoints/test_base.py
@@ -2,7 +2,7 @@ from __future__ import absolute_import, unicode_literals
 
 from re import sub
 
-from mock import MagicMock
+from unittest.mock import MagicMock
 
 from oauthlib.common import CaseInsensitiveDict, safe_string_equals
 from oauthlib.oauth1 import Client, RequestValidator
diff --git a/tests/oauth1/rfc5849/endpoints/test_request_token.py b/tests/oauth1/rfc5849/endpoints/test_request_token.py
index 5c9ae88..3764528 100644
--- a/tests/oauth1/rfc5849/endpoints/test_request_token.py
+++ b/tests/oauth1/rfc5849/endpoints/test_request_token.py
@@ -1,6 +1,6 @@
 from __future__ import absolute_import, unicode_literals
 
-from mock import ANY, MagicMock
+from unittest.mock import ANY, MagicMock
 
 from oauthlib.oauth1 import RequestValidator
 from oauthlib.oauth1.rfc5849 import Client
diff --git a/tests/oauth1/rfc5849/endpoints/test_resource.py b/tests/oauth1/rfc5849/endpoints/test_resource.py
index b71412a..9fd5422 100644
--- a/tests/oauth1/rfc5849/endpoints/test_resource.py
+++ b/tests/oauth1/rfc5849/endpoints/test_resource.py
@@ -1,6 +1,6 @@
 from __future__ import absolute_import, unicode_literals
 
-from mock import ANY, MagicMock
+from unittest.mock import ANY, MagicMock
 
 from oauthlib.oauth1 import RequestValidator
 from oauthlib.oauth1.rfc5849 import Client
diff --git a/tests/oauth1/rfc5849/endpoints/test_signature_only.py b/tests/oauth1/rfc5849/endpoints/test_signature_only.py
index 1d758b1..4c2c04b 100644
--- a/tests/oauth1/rfc5849/endpoints/test_signature_only.py
+++ b/tests/oauth1/rfc5849/endpoints/test_signature_only.py
@@ -1,6 +1,6 @@
 from __future__ import absolute_import, unicode_literals
 
-from mock import ANY, MagicMock
+from unittest.mock import ANY, MagicMock
 
 from oauthlib.oauth1 import RequestValidator
 from oauthlib.oauth1.rfc5849 import Client
diff --git a/tests/oauth2/rfc6749/clients/test_backend_application.py b/tests/oauth2/rfc6749/clients/test_backend_application.py
index aa2ba2b..0ae92a5 100644
--- a/tests/oauth2/rfc6749/clients/test_backend_application.py
+++ b/tests/oauth2/rfc6749/clients/test_backend_application.py
@@ -3,7 +3,7 @@ from __future__ import absolute_import, unicode_literals
 
 import os
 
-from mock import patch
+from unittest.mock import patch
 
 from oauthlib import signals
 from oauthlib.oauth2 import BackendApplicationClient
diff --git a/tests/oauth2/rfc6749/clients/test_legacy_application.py b/tests/oauth2/rfc6749/clients/test_legacy_application.py
index 21af4a3..eeaa990 100644
--- a/tests/oauth2/rfc6749/clients/test_legacy_application.py
+++ b/tests/oauth2/rfc6749/clients/test_legacy_application.py
@@ -3,7 +3,7 @@ from __future__ import absolute_import, unicode_literals
 
 import os
 
-from mock import patch
+from unittest.mock import patch
 
 from oauthlib import signals
 from oauthlib.oauth2 import LegacyApplicationClient
diff --git a/tests/oauth2/rfc6749/clients/test_mobile_application.py b/tests/oauth2/rfc6749/clients/test_mobile_application.py
index 622b275..7595ce9 100644
--- a/tests/oauth2/rfc6749/clients/test_mobile_application.py
+++ b/tests/oauth2/rfc6749/clients/test_mobile_application.py
@@ -3,7 +3,7 @@ from __future__ import absolute_import, unicode_literals
 
 import os
 
-from mock import patch
+from unittest.mock import patch
 
 from oauthlib import signals
 from oauthlib.oauth2 import MobileApplicationClient
diff --git a/tests/oauth2/rfc6749/clients/test_service_application.py b/tests/oauth2/rfc6749/clients/test_service_application.py
index dc337cf..ceb48f2 100644
--- a/tests/oauth2/rfc6749/clients/test_service_application.py
+++ b/tests/oauth2/rfc6749/clients/test_service_application.py
@@ -5,7 +5,7 @@ import os
 from time import time
 
 import jwt
-from mock import patch
+from unittest.mock import patch
 
 from oauthlib.common import Request
 from oauthlib.oauth2 import ServiceApplicationClient
diff --git a/tests/oauth2/rfc6749/clients/test_web_application.py b/tests/oauth2/rfc6749/clients/test_web_application.py
index 092f93e..eb6af27 100644
--- a/tests/oauth2/rfc6749/clients/test_web_application.py
+++ b/tests/oauth2/rfc6749/clients/test_web_application.py
@@ -5,7 +5,7 @@ import datetime
 import os
 import warnings
 
-from mock import patch
+from unittest.mock import patch
 
 from oauthlib import common, signals
 from oauthlib.oauth2 import (BackendApplicationClient, Client,
diff --git a/tests/oauth2/rfc6749/endpoints/test_client_authentication.py b/tests/oauth2/rfc6749/endpoints/test_client_authentication.py
index 133da59..799f510 100644
--- a/tests/oauth2/rfc6749/endpoints/test_client_authentication.py
+++ b/tests/oauth2/rfc6749/endpoints/test_client_authentication.py
@@ -13,7 +13,7 @@ from __future__ import absolute_import, unicode_literals
 
 import json
 
-import mock
+from unittest import mock
 
 from oauthlib.oauth2 import (BackendApplicationServer, LegacyApplicationServer,
                              MobileApplicationServer, RequestValidator,
diff --git a/tests/oauth2/rfc6749/endpoints/test_credentials_preservation.py b/tests/oauth2/rfc6749/endpoints/test_credentials_preservation.py
index e7c66b6..6cd25b2 100644
--- a/tests/oauth2/rfc6749/endpoints/test_credentials_preservation.py
+++ b/tests/oauth2/rfc6749/endpoints/test_credentials_preservation.py
@@ -7,7 +7,7 @@ from __future__ import absolute_import, unicode_literals
 
 import json
 
-import mock
+from unittest import mock
 
 from oauthlib.oauth2 import (MobileApplicationServer, RequestValidator,
                              WebApplicationServer)
diff --git a/tests/oauth2/rfc6749/endpoints/test_error_responses.py b/tests/oauth2/rfc6749/endpoints/test_error_responses.py
index 2479836..8697e32 100644
--- a/tests/oauth2/rfc6749/endpoints/test_error_responses.py
+++ b/tests/oauth2/rfc6749/endpoints/test_error_responses.py
@@ -4,7 +4,7 @@ from __future__ import absolute_import, unicode_literals
 
 import json
 
-import mock
+from unittest import mock
 
 from oauthlib.common import urlencode
 from oauthlib.oauth2 import (BackendApplicationServer, LegacyApplicationServer,
diff --git a/tests/oauth2/rfc6749/endpoints/test_extra_credentials.py b/tests/oauth2/rfc6749/endpoints/test_extra_credentials.py
index a12fcd2..5d78d04 100644
--- a/tests/oauth2/rfc6749/endpoints/test_extra_credentials.py
+++ b/tests/oauth2/rfc6749/endpoints/test_extra_credentials.py
@@ -2,7 +2,7 @@
 """
 from __future__ import absolute_import, unicode_literals
 
-import mock
+from unittest import mock
 
 from oauthlib.oauth2 import (BackendApplicationServer, LegacyApplicationServer,
                              MobileApplicationServer, RequestValidator,
diff --git a/tests/oauth2/rfc6749/endpoints/test_introspect_endpoint.py b/tests/oauth2/rfc6749/endpoints/test_introspect_endpoint.py
index ae3deae..f9827ce 100644
--- a/tests/oauth2/rfc6749/endpoints/test_introspect_endpoint.py
+++ b/tests/oauth2/rfc6749/endpoints/test_introspect_endpoint.py
@@ -3,7 +3,7 @@ from __future__ import absolute_import, unicode_literals
 
 from json import loads
 
-from mock import MagicMock
+from unittest.mock import MagicMock
 
 from oauthlib.common import urlencode
 from oauthlib.oauth2 import RequestValidator, IntrospectEndpoint
diff --git a/tests/oauth2/rfc6749/endpoints/test_resource_owner_association.py b/tests/oauth2/rfc6749/endpoints/test_resource_owner_association.py
index e823286..472330c 100644
--- a/tests/oauth2/rfc6749/endpoints/test_resource_owner_association.py
+++ b/tests/oauth2/rfc6749/endpoints/test_resource_owner_association.py
@@ -4,7 +4,7 @@ from __future__ import absolute_import, unicode_literals
 
 import json
 
-import mock
+from unittest import mock
 
 from oauthlib.oauth2 import (BackendApplicationServer, LegacyApplicationServer,
                              MobileApplicationServer, RequestValidator,
diff --git a/tests/oauth2/rfc6749/endpoints/test_revocation_endpoint.py b/tests/oauth2/rfc6749/endpoints/test_revocation_endpoint.py
index 17be3a5..aec5acc 100644
--- a/tests/oauth2/rfc6749/endpoints/test_revocation_endpoint.py
+++ b/tests/oauth2/rfc6749/endpoints/test_revocation_endpoint.py
@@ -3,7 +3,7 @@ from __future__ import absolute_import, unicode_literals
 
 from json import loads
 
-from mock import MagicMock
+from unittest.mock import MagicMock
 
 from oauthlib.common import urlencode
 from oauthlib.oauth2 import RequestValidator, RevocationEndpoint
diff --git a/tests/oauth2/rfc6749/endpoints/test_scope_handling.py b/tests/oauth2/rfc6749/endpoints/test_scope_handling.py
index 4f27963..97e00ed 100644
--- a/tests/oauth2/rfc6749/endpoints/test_scope_handling.py
+++ b/tests/oauth2/rfc6749/endpoints/test_scope_handling.py
@@ -7,7 +7,7 @@ from __future__ import absolute_import, unicode_literals
 
 import json
 
-import mock
+from unittest import mock
 
 from oauthlib.oauth2 import (BackendApplicationServer, LegacyApplicationServer,
                              MobileApplicationServer, RequestValidator, Server,
diff --git a/tests/oauth2/rfc6749/grant_types/test_authorization_code.py b/tests/oauth2/rfc6749/grant_types/test_authorization_code.py
index 2c9db3c..4b45875 100644
--- a/tests/oauth2/rfc6749/grant_types/test_authorization_code.py
+++ b/tests/oauth2/rfc6749/grant_types/test_authorization_code.py
@@ -3,7 +3,7 @@ from __future__ import absolute_import, unicode_literals
 
 import json
 
-import mock
+from unittest import mock
 
 from oauthlib.common import Request
 from oauthlib.oauth2.rfc6749 import errors
diff --git a/tests/oauth2/rfc6749/grant_types/test_client_credentials.py b/tests/oauth2/rfc6749/grant_types/test_client_credentials.py
index edc6bfe..fbd054f 100644
--- a/tests/oauth2/rfc6749/grant_types/test_client_credentials.py
+++ b/tests/oauth2/rfc6749/grant_types/test_client_credentials.py
@@ -3,7 +3,7 @@ from __future__ import absolute_import, unicode_literals
 
 import json
 
-import mock
+from unittest import mock
 
 from oauthlib.common import Request
 from oauthlib.oauth2.rfc6749.grant_types import ClientCredentialsGrant
diff --git a/tests/oauth2/rfc6749/grant_types/test_implicit.py b/tests/oauth2/rfc6749/grant_types/test_implicit.py
index 0c18cab..c4bbeda 100644
--- a/tests/oauth2/rfc6749/grant_types/test_implicit.py
+++ b/tests/oauth2/rfc6749/grant_types/test_implicit.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 from __future__ import absolute_import, unicode_literals
 
-import mock
+from unittest import mock
 
 from oauthlib.common import Request
 from oauthlib.oauth2.rfc6749.grant_types import ImplicitGrant
diff --git a/tests/oauth2/rfc6749/grant_types/test_refresh_token.py b/tests/oauth2/rfc6749/grant_types/test_refresh_token.py
index 32a0977..ef64c69 100644
--- a/tests/oauth2/rfc6749/grant_types/test_refresh_token.py
+++ b/tests/oauth2/rfc6749/grant_types/test_refresh_token.py
@@ -3,7 +3,7 @@ from __future__ import absolute_import, unicode_literals
 
 import json
 
-import mock
+from unittest import mock
 
 from oauthlib.common import Request
 from oauthlib.oauth2.rfc6749 import errors
diff --git a/tests/oauth2/rfc6749/grant_types/test_resource_owner_password.py b/tests/oauth2/rfc6749/grant_types/test_resource_owner_password.py
index 82e0524..0373e32 100644
--- a/tests/oauth2/rfc6749/grant_types/test_resource_owner_password.py
+++ b/tests/oauth2/rfc6749/grant_types/test_resource_owner_password.py
@@ -3,7 +3,7 @@ from __future__ import absolute_import, unicode_literals
 
 import json
 
-import mock
+from unittest import mock
 
 from oauthlib.common import Request
 from oauthlib.oauth2.rfc6749 import errors
diff --git a/tests/oauth2/rfc6749/test_parameters.py b/tests/oauth2/rfc6749/test_parameters.py
index 48b7eac..fdbd1df 100644
--- a/tests/oauth2/rfc6749/test_parameters.py
+++ b/tests/oauth2/rfc6749/test_parameters.py
@@ -1,6 +1,6 @@
 from __future__ import absolute_import, unicode_literals
 
-from mock import patch
+from unittest.mock import patch
 
 from oauthlib import signals
 from oauthlib.oauth2.rfc6749.errors import *
diff --git a/tests/oauth2/rfc6749/test_server.py b/tests/oauth2/rfc6749/test_server.py
index 2c6ecff..f966547 100644
--- a/tests/oauth2/rfc6749/test_server.py
+++ b/tests/oauth2/rfc6749/test_server.py
@@ -3,7 +3,7 @@ from __future__ import absolute_import, unicode_literals
 
 import json
 
-import mock
+from unittest import mock
 
 from oauthlib import common
 from oauthlib.oauth2.rfc6749 import errors, tokens
diff --git a/tests/oauth2/rfc6749/test_tokens.py b/tests/oauth2/rfc6749/test_tokens.py
index e6f49b1..219486e 100644
--- a/tests/oauth2/rfc6749/test_tokens.py
+++ b/tests/oauth2/rfc6749/test_tokens.py
@@ -1,6 +1,6 @@
 from __future__ import absolute_import, unicode_literals
 
-import mock
+from unittest import mock
 
 from oauthlib.common import Request
 from oauthlib.oauth2.rfc6749.tokens import (
diff --git a/tests/openid/connect/core/endpoints/test_claims_handling.py b/tests/openid/connect/core/endpoints/test_claims_handling.py
index 5f39d96..f86a176 100644
--- a/tests/openid/connect/core/endpoints/test_claims_handling.py
+++ b/tests/openid/connect/core/endpoints/test_claims_handling.py
@@ -8,7 +8,7 @@ The claims parameter is an optional query param for the Authorization Request en
 """
 from __future__ import absolute_import, unicode_literals
 
-import mock
+from unittest import mock
 
 from oauthlib.openid import RequestValidator
 from oauthlib.openid.connect.core.endpoints.pre_configured import Server
diff --git a/tests/openid/connect/core/endpoints/test_openid_connect_params_handling.py b/tests/openid/connect/core/endpoints/test_openid_connect_params_handling.py
index 517239a..aaedbc2 100644
--- a/tests/openid/connect/core/endpoints/test_openid_connect_params_handling.py
+++ b/tests/openid/connect/core/endpoints/test_openid_connect_params_handling.py
@@ -1,6 +1,6 @@
 from __future__ import absolute_import, unicode_literals
 
-import mock
+from unittest import mock
 
 from oauthlib.oauth2 import InvalidRequestError
 from oauthlib.oauth2.rfc6749.endpoints.authorization import \
diff --git a/tests/openid/connect/core/endpoints/test_userinfo_endpoint.py b/tests/openid/connect/core/endpoints/test_userinfo_endpoint.py
index 4593d79..ff7986b 100644
--- a/tests/openid/connect/core/endpoints/test_userinfo_endpoint.py
+++ b/tests/openid/connect/core/endpoints/test_userinfo_endpoint.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 from __future__ import absolute_import, unicode_literals
 
-import mock
+from unittest import mock
 import json
 
 from oauthlib.openid import RequestValidator
diff --git a/tests/openid/connect/core/grant_types/test_authorization_code.py b/tests/openid/connect/core/grant_types/test_authorization_code.py
index b721a19..06b1340 100644
--- a/tests/openid/connect/core/grant_types/test_authorization_code.py
+++ b/tests/openid/connect/core/grant_types/test_authorization_code.py
@@ -3,7 +3,7 @@ from __future__ import absolute_import, unicode_literals
 
 import json
 
-import mock
+from unittest import mock
 
 from oauthlib.common import Request
 from oauthlib.oauth2.rfc6749.tokens import BearerToken
diff --git a/tests/openid/connect/core/grant_types/test_base.py b/tests/openid/connect/core/grant_types/test_base.py
index d506b7e..786b24b 100644
--- a/tests/openid/connect/core/grant_types/test_base.py
+++ b/tests/openid/connect/core/grant_types/test_base.py
@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-import mock
+from unittest import mock
 import time
 
 from oauthlib.common import Request
diff --git a/tests/openid/connect/core/grant_types/test_dispatchers.py b/tests/openid/connect/core/grant_types/test_dispatchers.py
index 9e45d65..c746e25 100644
--- a/tests/openid/connect/core/grant_types/test_dispatchers.py
+++ b/tests/openid/connect/core/grant_types/test_dispatchers.py
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 from __future__ import absolute_import, unicode_literals
-import mock
+from unittest import mock
 
 from oauthlib.common import Request
 
diff --git a/tests/openid/connect/core/grant_types/test_hybrid.py b/tests/openid/connect/core/grant_types/test_hybrid.py
index 0aa0add..336c9f2 100644
--- a/tests/openid/connect/core/grant_types/test_hybrid.py
+++ b/tests/openid/connect/core/grant_types/test_hybrid.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 from __future__ import absolute_import, unicode_literals
 
-import mock
+from unittest import mock
 
 from oauthlib.oauth2.rfc6749 import errors
 from oauthlib.oauth2.rfc6749.tokens import BearerToken
diff --git a/tests/openid/connect/core/grant_types/test_implicit.py b/tests/openid/connect/core/grant_types/test_implicit.py
index 1ee805c..c1aadaf 100644
--- a/tests/openid/connect/core/grant_types/test_implicit.py
+++ b/tests/openid/connect/core/grant_types/test_implicit.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 from __future__ import absolute_import, unicode_literals
 
-import mock
+from unittest import mock
 
 from oauthlib.common import Request
 from oauthlib.oauth2.rfc6749 import errors
diff --git a/tests/openid/connect/core/test_server.py b/tests/openid/connect/core/test_server.py
index 756c9d0..87b3a9e 100644
--- a/tests/openid/connect/core/test_server.py
+++ b/tests/openid/connect/core/test_server.py
@@ -3,7 +3,7 @@ from __future__ import absolute_import, unicode_literals
 
 import json
 
-import mock
+from unittest import mock
 
 from oauthlib.oauth2.rfc6749 import errors
 from oauthlib.oauth2.rfc6749.endpoints.authorization import AuthorizationEndpoint
diff --git a/tests/openid/connect/core/test_tokens.py b/tests/openid/connect/core/test_tokens.py
index fde89d6..7dc7433 100644
--- a/tests/openid/connect/core/test_tokens.py
+++ b/tests/openid/connect/core/test_tokens.py
@@ -1,6 +1,6 @@
 from __future__ import absolute_import, unicode_literals
 
-import mock
+from unittest import mock
 
 from oauthlib.openid.connect.core.tokens import JWTToken