Browse Source

tests: xfail if lib not available

Fabian Peter Hammerle 4 years ago
parent
commit
3f09439a18
1 changed files with 3 additions and 0 deletions
  1. 3 0
      tests/dlinfo_test.py

+ 3 - 0
tests/dlinfo_test.py

@@ -9,9 +9,12 @@ from dlinfo import DLInfo
 @pytest.mark.parametrize('lib_name', [
     'c',
     'dl',
+    'grasp_python',
 ])
 def test_dlinfo_path(lib_name):
     lib_filename = ctypes.util.find_library(lib_name)
+    if not lib_filename:
+        pytest.xfail('lib{} not found'.format(lib_name))
     lib = ctypes.cdll.LoadLibrary(lib_filename)
     dlinfo = DLInfo(lib)
     assert os.path.exists(dlinfo.path)