summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/ext/ssl_protocols.py17
-rw-r--r--testsuite/pylintrc.conf2
-rw-r--r--testsuite/requirements.txt2
3 files changed, 19 insertions, 2 deletions
diff --git a/testsuite/ext/ssl_protocols.py b/testsuite/ext/ssl_protocols.py
new file mode 100644
index 000000000..66068d2a9
--- /dev/null
+++ b/testsuite/ext/ssl_protocols.py
@@ -0,0 +1,17 @@
+try:
+ from logilab.astng import MANAGER, scoped_nodes, node_classes
+ PYLINT=0
+except ImportError:
+ from astroid import MANAGER, scoped_nodes, node_classes
+ PYLINT=1
+
+def ssl_transform(module):
+ if module.name == 'ssl':
+ for proto in ('SSLv23', 'TLSv1'):
+ module.locals['PROTOCOL_%s' % proto] = [node_classes.Const()]
+
+def register(linter):
+ if PYLINT == 0:
+ MANAGER.register_transformer(ssl_transform)
+ else:
+ MANAGER.register_transform(scoped_nodes.Module, ssl_transform)
diff --git a/testsuite/pylintrc.conf b/testsuite/pylintrc.conf
index 1d3ba8c88..50ece77db 100644
--- a/testsuite/pylintrc.conf
+++ b/testsuite/pylintrc.conf
@@ -19,7 +19,7 @@ persistent=no
# List of plugins (as comma separated values of python modules names) to load,
# usually to register additional checkers.
-load-plugins=ext.exception_messages
+load-plugins=ext.exception_messages,ext.ssl_protocols
[MESSAGES CONTROL]
diff --git a/testsuite/requirements.txt b/testsuite/requirements.txt
index dce47c338..d67c64db6 100644
--- a/testsuite/requirements.txt
+++ b/testsuite/requirements.txt
@@ -4,6 +4,6 @@ mock
sphinx
pylint<0.29
pep8
-python-daemon
+python-daemon<2.0.0
genshi
argparse