aboutsummaryrefslogtreecommitdiff
path: root/unittest
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2017-12-12 18:12:43 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2018-02-23 15:42:38 +0100
commit87478e8a8a5329a4f5e4a59364bd1f7f359b71e6 (patch)
tree6a5daa594df492d9f0de58d296fe374b8288300d /unittest
parent60b14805b2cb80808c2fcf644699e7cde8e088ac (diff)
downloadlibnitrokey-87478e8a8a5329a4f5e4a59364bd1f7f359b71e6.tar.gz
libnitrokey-87478e8a8a5329a4f5e4a59364bd1f7f359b71e6.tar.bz2
Allow to call CFFI loading function from Python console
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'unittest')
-rw-r--r--unittest/conftest.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/unittest/conftest.py b/unittest/conftest.py
index 26536cf..49f1502 100644
--- a/unittest/conftest.py
+++ b/unittest/conftest.py
@@ -34,7 +34,7 @@ def skip_if_device_version_lower_than(allowed_devices):
@pytest.fixture(scope="module")
-def C(request):
+def C(request=None):
fp = '../NK_C_API.h'
declarations = []
@@ -99,7 +99,8 @@ def C(request):
C.NK_logout()
print('Finished')
- request.addfinalizer(fin)
+ if request:
+ request.addfinalizer(fin)
# C.NK_set_debug(True)
C.NK_set_debug_level(int(os.environ.get('LIBNK_DEBUG', 3)))