diff --git a/pytest.ini b/pytest.ini
index 61aeeba048eb437f95fb87dda6a38d31f75e56c9..fe398a0babf5a774f332240c7ce22d38f7330ba1 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -1,4 +1,4 @@
 [pytest]
 norecursedirs = build docs .*
 asyncio_mode = strict
-addopts = "--import-mode=importlib"
+consider_namespace_packages = true
diff --git a/requirements-test.txt b/requirements-test.txt
index 486a06639277220d9d336f164fce58417b10b091..2e569e9859fe6c56600c79354569227eea63dbff 100644
--- a/requirements-test.txt
+++ b/requirements-test.txt
@@ -1,5 +1,5 @@
 msgpack
-pytest
+pytest >= 8.1
 pytest-mock
 pyyaml
 swh.core[testing] >= 3.0.0