From e4c707d80755dc0a1c5ae4bafa65e14c24ab789c Mon Sep 17 00:00:00 2001
From: Antoine Lambert <anlambert@softwareheritage.org>
Date: Fri, 1 Dec 2023 14:42:34 +0100
Subject: [PATCH] pytest.ini: Ensure '--import-mode importlib' option is always
 used

Fix hanging test when executed outside tox.
---
 pytest.ini | 8 +++++---
 tox.ini    | 1 -
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/pytest.ini b/pytest.ini
index cb6b92be..8d2cc346 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -1,7 +1,9 @@
 [pytest]
-# We need this to avoid conflicts between the autoloaded fixture, and the
-# manually loaded one.
-addopts = -p no:pytest_swh_scheduler
+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
diff --git a/tox.ini b/tox.ini
index 0df11b76..46e9cb56 100644
--- a/tox.ini
+++ b/tox.ini
@@ -13,7 +13,6 @@ deps =
   pytest-cov
 commands =
   pytest --doctest-modules \
-         --import-mode importlib \
          --rootdir {envsitepackagesdir} \
          --cov={envsitepackagesdir}/swh/lister \
          --cov-branch \
-- 
GitLab