diff --git a/pytest.ini b/pytest.ini
index a604a8e2a4fe8e1a6349d8c207b62badd0e8e35a..732e3bd2f5ed739b27b5d7bb821869aaafad5c75 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -1,5 +1,6 @@
 [pytest]
-addopts = -p no:flask --import-mode=importlib
+addopts = -p no:flask
 norecursedirs = build docs .*
 asyncio_mode = strict
 DJANGO_SETTINGS_MODULE = swh.auth.tests.django.app.apptest.settings
+consider_namespace_packages = true
diff --git a/requirements-test.txt b/requirements-test.txt
index b4ba39f73bbb7fed08d2dd3f179a186bfc7dbc04..c0f5c5449d9e7925be48f97d3107e5d97686ed19 100644
--- a/requirements-test.txt
+++ b/requirements-test.txt
@@ -1,6 +1,6 @@
 django-stubs
 djangorestframework-stubs
-pytest
+pytest >= 8.1
 pytest-django
 pytest-mock
 requests_mock
diff --git a/tox.ini b/tox.ini
index bf032884c70eaf6915080a5d26f1dbf034706bd1..386638c6dc86c20ed0b2c20803bf21ae1b10e2e0 100644
--- a/tox.ini
+++ b/tox.ini
@@ -7,6 +7,7 @@ envlist =
   py3
 
 [testenv]
+use_develop = true
 extras =
   testing
   django
@@ -15,14 +16,10 @@ deps =
   pytest-cov
 commands =
   pytest --doctest-modules \
-         --rootdir {envsitepackagesdir} \
-         --cov={envsitepackagesdir}/swh/auth \
+         --cov=swh/auth \
          --cov-branch \
-         {envsitepackagesdir}/swh/auth \
+         swh/auth \
          {posargs}
-# --rootdir (with --import-mode from pytest.ini) are required to make tests
-# that depends on the test file to be a proper submodule of the swh namespace
-# after migration to PEP420 (implicit namespace).
 
 [testenv:black]
 skip_install = true