This is an automated email from the ASF dual-hosted git repository.
spolavarapu pushed a commit to branch ranger-2.2
in repository https://gitbox.apache.org/repos/asf/ranger.git
The following commit(s) were added to refs/heads/ranger-2.2 by this push:
new f5cc668 RANGER-3190: Skip Python unit tests if requests not present
f5cc668 is described below
commit f5cc6680ce595ec7566210024bdafbca9461e966
Author: Abhishek Kumar <[email protected]>
AuthorDate: Wed Feb 24 20:55:49 2021 -0500
RANGER-3190: Skip Python unit tests if requests not present
Signed-off-by: Sailaja Polavarapu <[email protected]>
---
intg/src/test/python/test_ranger_client.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/intg/src/test/python/test_ranger_client.py
b/intg/src/test/python/test_ranger_client.py
index a330683..cbedcbf 100644
--- a/intg/src/test/python/test_ranger_client.py
+++ b/intg/src/test/python/test_ranger_client.py
@@ -21,7 +21,11 @@ import unittest
from unittest.mock import patch
from apache_ranger.exceptions import RangerServiceException
from apache_ranger.model.ranger_service import RangerService
-from apache_ranger.client.ranger_client import API, HttpMethod, HTTPStatus,
RangerClient
+
+try:
+ from apache_ranger.client.ranger_client import API, HttpMethod,
HTTPStatus, RangerClient
+except ModuleNotFoundError: # requests not installed
+ exit() # skipping unit tests
class MockResponse: