From 3bdbb3d513e4a6ff785c1e0634a6a0f5f5520b50 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Wed, 18 Sep 2024 11:35:24 +0200 Subject: [PATCH] Don't import cwd ifcopenshell folder when running tests --- src/ifcopenshell-python/test/bootstrap.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ifcopenshell-python/test/bootstrap.py b/src/ifcopenshell-python/test/bootstrap.py index 8fa9c5b20b..54536121ae 100644 --- a/src/ifcopenshell-python/test/bootstrap.py +++ b/src/ifcopenshell-python/test/bootstrap.py @@ -16,6 +16,14 @@ # You should have received a copy of the GNU Lesser General Public License # along with IfcOpenShell. If not, see . +import os +import sys + +if os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) == sys.path[0]: + # Don't import ifcopenshell from local directory, because it most likely + # does not contain the built binary + sys.path[0:1] = [] + import pytest import ifcopenshell import ifcopenshell.api.project