From 1a446933032beca0b1c5764acf23940ceb7a43ab Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Wed, 11 Oct 2017 15:35:19 +0200 Subject: Allow to use library path in tests from environment variable Signed-off-by: Szczepan Zalega --- unittest/conftest.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/unittest/conftest.py b/unittest/conftest.py index ef4539c..a53b005 100644 --- a/unittest/conftest.py +++ b/unittest/conftest.py @@ -36,13 +36,15 @@ def C(request): import os, sys path_build = os.path.join("..", "build") paths = [ + os.environ.get('LIBNK_PATH', None), os.path.join(path_build,"libnitrokey.so"), os.path.join(path_build,"libnitrokey.dylib"), os.path.join(path_build,"libnitrokey.dll"), os.path.join(path_build,"nitrokey.dll"), ] for p in paths: - print(p) + if not p: continue + print("Trying " +p) p = os.path.abspath(p) if os.path.exists(p): print("Found: "+p) @@ -50,7 +52,6 @@ def C(request): break else: print("File does not exist: " + p) - print("Trying another") if not C: print("No library file found") sys.exit(1) -- cgit v1.2.3