Skip to content

Commit

Permalink
Swap ldap import in test with check if available
Browse files Browse the repository at this point in the history
  • Loading branch information
johannaengland committed Nov 22, 2024
1 parent 4cf48e2 commit afbe765
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/unittests/web/ldapauth_test.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import importlib.util
import pytest

from nav.config import NAVConfigParser
from nav.web.auth.ldap import LDAPUser, open_ldap
from mock import Mock, patch

try:
import ldap
except ImportError:
found = importlib.util.find_spec('ldap')
if not found:
pytestmark = pytest.mark.skip(reason="ldap module is not available")


Expand Down

0 comments on commit afbe765

Please sign in to comment.