From b083b4f1f929cf0b8e2c4b02db4e24e2538e447d Mon Sep 17 00:00:00 2001
From: Antoine Lambert <anlambert@softwareheritage.org>
Date: Wed, 13 Mar 2024 10:58:03 +0100
Subject: [PATCH] pytest: Fix tests execution with pytest 8.1

Remove use of --import-mode=importlib pytest option and use
new option consider_namespace_packages to fix tests execution
with latest pytest release.
---
 pytest.ini            | 2 +-
 requirements-test.txt | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pytest.ini b/pytest.ini
index 2de77d0c..657a529f 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -3,6 +3,6 @@ addopts =
   # we need this to avoid conflicts between the autoloaded fixture,
   # and the manually loaded one.
   -p no:pytest_swh_scheduler
-  --import-mode=importlib
 norecursedirs = build docs .*
 asyncio_mode = strict
+consider_namespace_packages = true
diff --git a/requirements-test.txt b/requirements-test.txt
index b7275cdb..442fd85e 100644
--- a/requirements-test.txt
+++ b/requirements-test.txt
@@ -1,5 +1,5 @@
 pandas
-pytest
+pytest >= 8.1
 pytest-mock
 requests_mock
 swh-scheduler[testing]
-- 
GitLab