Repository: kevin1024/vcrpy

Issue:
python 3.8 vcrpy 4.0.1 No module named 'mock'
```
python3.8/site-packages/vcr/patch.py", line 5, in <module>
    import mock
ModuleNotFoundError: No module named 'mock'
```

my suggestion: everywhere in projects change:

import mock -> from unittest import mock

Discussion:
neozenith: Awaiting CI and will pull the trigger for the patch release in an hour or two.
llybin: I think need to delete mock here also: https://github.com/kevin1024/vcrpy/blob/master/tox.ini#L66
that why 4.0 was not failed.
neozenith: @llybin thanks for the quick reviews. This is really appreciated. 

The deleted imports earlier have been addressed. That was weird issue with VSCode, I saw when I reviewed the PR too.

Great catch with the tox import masking the issue.

Patch:
diff --git a/docs/changelog.rst b/docs/changelog.rst
index 17e90db..f149199 100644
--- a/docs/changelog.rst
+++ b/docs/changelog.rst
@@ -9,8 +9,10 @@ All help in providing PRs to close out bug issues is appreciated. Even if that i
 
 -  UNRELEASED
     - ...
-
-
+-  4.0.2
+    - Fix mock imports as reported in #504 by @llybin. Thank you.
+-  4.0.1 
+    - Fix logo alignment for PyPI 
 -  4.0.0
     - Remove Python2 support (@hugovk)
     - Add Python 3.8 TravisCI support (@neozenith)
diff --git a/tox.ini b/tox.ini
index e73f477..20c4b73 100644
--- a/tox.ini
+++ b/tox.ini
@@ -63,7 +63,6 @@ commands =
     ./runtests.sh --cov=./vcr --cov-branch --cov-report=xml --cov-append {posargs}
 deps =
     Flask
-    mock
     pytest
     pytest-httpbin
     pytest-cov
diff --git a/vcr/__init__.py b/vcr/__init__.py
index 02b6fb1..070d3e9 100644
--- a/vcr/__init__.py
+++ b/vcr/__init__.py
@@ -2,7 +2,7 @@ import logging
 from .config import VCR
 from logging import NullHandler
 
-__version__ = "4.0.1"
+__version__ = "4.0.2"
 
 logging.getLogger(__name__).addHandler(NullHandler())
 
diff --git a/vcr/patch.py b/vcr/patch.py
index 40b462a..3b30407 100644
--- a/vcr/patch.py
+++ b/vcr/patch.py
@@ -2,7 +2,7 @@
 import contextlib
 import functools
 import itertools
-import mock
+from unittest import mock
 
 from .stubs import VCRHTTPConnection, VCRHTTPSConnection
 import http.client as httplib


Test patch:
diff --git a/tests/unit/test_cassettes.py b/tests/unit/test_cassettes.py
index 915f235..90a05c7 100644
--- a/tests/unit/test_cassettes.py
+++ b/tests/unit/test_cassettes.py
@@ -1,13 +1,12 @@
 import contextlib
 import copy
+import http.client as httplib
 import inspect
-import mock
 import os
+from unittest import mock
 
-import http.client as httplib
 import pytest
 import yaml
-
 from vcr.cassette import Cassette
 from vcr.errors import UnhandledHTTPRequestError
 from vcr.patch import force_reset
diff --git a/tests/unit/test_errors.py b/tests/unit/test_errors.py
index fe79253..62c622a 100644
--- a/tests/unit/test_errors.py
+++ b/tests/unit/test_errors.py
@@ -1,4 +1,4 @@
-import mock
+from unittest import mock
 
 import pytest
 
diff --git a/tests/unit/test_filters.py b/tests/unit/test_filters.py
index d40bb0c..69d26bf 100644
--- a/tests/unit/test_filters.py
+++ b/tests/unit/test_filters.py
@@ -11,7 +11,7 @@ from vcr.filters import (
 from vcr.request import Request
 import gzip
 import json
-import mock
+from unittest import mock
 import zlib
 
 
diff --git a/tests/unit/test_matchers.py b/tests/unit/test_matchers.py
index 6c2bd4a..5e45ab6 100644
--- a/tests/unit/test_matchers.py
+++ b/tests/unit/test_matchers.py
@@ -1,5 +1,5 @@
 import itertools
-import mock
+from unittest import mock
 
 import pytest
 
diff --git a/tests/unit/test_serialize.py b/tests/unit/test_serialize.py
index a7efb77..c06d6d3 100644
--- a/tests/unit/test_serialize.py
+++ b/tests/unit/test_serialize.py
@@ -1,5 +1,5 @@
 # -*- encoding: utf-8 -*-
-import mock
+from unittest import mock
 
 import pytest
 
diff --git a/tests/unit/test_stubs.py b/tests/unit/test_stubs.py
index 07d15c1..ee05134 100644
--- a/tests/unit/test_stubs.py
+++ b/tests/unit/test_stubs.py
@@ -1,4 +1,4 @@
-import mock
+from unittest import mock
 
 from vcr.stubs import VCRHTTPSConnection
 from vcr.cassette import Cassette
diff --git a/tests/unit/test_vcr.py b/tests/unit/test_vcr.py
index 49e9000..c49a4b9 100644
--- a/tests/unit/test_vcr.py
+++ b/tests/unit/test_vcr.py
@@ -1,4 +1,4 @@
-import mock
+from unittest import mock
 import os
 
 import pytest