diff --git a/swh/storage/tests/conftest.py b/swh/storage/tests/conftest.py
--- a/swh/storage/tests/conftest.py
+++ b/swh/storage/tests/conftest.py
@@ -3,12 +3,14 @@
 # License: GNU General Public License version 3, or any later version
 # See top-level LICENSE file for more information
 
+from distutils.version import LooseVersion
 import multiprocessing.util
 
 from hypothesis import HealthCheck, settings
 import pytest
 
 try:
+    import pytest_cov
     import pytest_cov.embed
 except ImportError:
     pytest_cov = None
@@ -35,7 +37,9 @@
 # This can still be overloaded via the --hypothesis-profile option.
 settings.load_profile("fast")
 
-if pytest_cov is not None:
+if pytest_cov is not None and LooseVersion(pytest_cov.__version__) < LooseVersion(
+    "4.0.0"
+):
     # pytest_cov + multiprocessing can cause a segmentation fault when starting
     # the child process <https://forge.softwareheritage.org/P706>; so we're
     # removing pytest-coverage's hook that runs when a child process starts.