From f6ad1ed144e6c021735b808670bd7ced6294f0f4 Mon Sep 17 00:00:00 2001
From: Antoine Lambert <anlambert@softwareheritage.org>
Date: Tue, 22 Mar 2022 11:14:28 +0100
Subject: [PATCH] pytest: Exclude build directory for tests discovery

Due to test modules being copied in subdirectories of the
build directory by setuptools, it makes pytest fail by raising
ImportPathMismatchError exceptions when invoked from root
directory of the module.

So ignore the build folder to discover tests.
---
 pytest.ini | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pytest.ini b/pytest.ini
index b15e082c..c5186e58 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -1,6 +1,6 @@
 [pytest]
 addopts = --doctest-modules -p no:pytest_swh_core
-norecursedirs = docs .*
+norecursedirs = build docs .*
 markers =
     fs: tests that involve filesystem ios
     requires_optional_deps: tests in test_cli.py that should not run if optional dependencies are not installed
-- 
GitLab