diff --git a/test-requirements.txt b/test-requirements.txt index a92055b..b58679f 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -3,5 +3,5 @@ nose2 six redis wrapt<=1.12.1;python_version<="3.4" -libpass -bcrypt +libpass;python_versions>="3.8" +bcrypt;python_versions>="3.8" diff --git a/tests/test_auth_plugins.py b/tests/test_auth_plugins.py index 2c5cf26..4dd86d1 100644 --- a/tests/test_auth_plugins.py +++ b/tests/test_auth_plugins.py @@ -28,6 +28,13 @@ class BasicHTTPAuthTestCase(unittest.TestCase): headers = {'Authorization': 'Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxx'} self.assertRaises(AuthenticationError, self.plugin.authenticate, headers, 'localhost', '1234') +try: + import passlib + PASSLIB_AVAILABLE = True +except ImportError: + PASSLIB_AVAILABLE = False + +@unittest.skipUnless(PASSLIB_AVAILABLE, "passlib package is not available") class HtpasswdAuthTestCase(unittest.TestCase): def setUp(self):