From df3a4f4d3dc93c1fc56bc46c985c090ca21cd6a4 Mon Sep 17 00:00:00 2001
From: Christian Heimes <cheimes@redhat.com>
Date: Mon, 29 Feb 2016 09:19:18 +0100
Subject: [PATCH 53/55] Fedora 24 fixes for Python 3.5 and pylint 1.5

Fedora 24 has Python 3.5 instead of Python 3.4. tox.ini now uses python3
to use any Python 3 interpreter.

Python 3.5 has unittest.mock in the stdlib. Tests must attempt to import
mock from unittest first.

Pylint 1.5 has deprecated a couple of old options. Dogtag doesn't use
the options anyway. I just removed them from dogtag.pylintrc.
---
 scripts/dogtag.pylintrc        | 18 ------------------
 tests/python/test_authority.py |  5 ++++-
 tox.ini                        |  7 ++++---
 3 files changed, 8 insertions(+), 22 deletions(-)

diff --git a/scripts/dogtag.pylintrc b/scripts/dogtag.pylintrc
index 061bba8ce30f30f773dbfa173e6b028cb08efcc7..98b8a2d694cb232dbaf8fb9a9d1cd170f253e768 100644
--- a/scripts/dogtag.pylintrc
+++ b/scripts/dogtag.pylintrc
@@ -7,9 +7,6 @@
 # pygtk.require().
 #init-hook=
 
-# Profiled execution.
-profile=no
-
 # Add files or directories to the blacklist. They should be base names, not
 # paths.
 ignore=CVS
@@ -70,10 +67,6 @@ reports=yes
 # (RP0004).
 evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
 
-# Add a comment according to your evaluation note. This is used by the global
-# evaluation report (RP0004).
-comment=no
-
 
 [FORMAT]
 
@@ -138,10 +131,6 @@ ignored-modules=ldap
 # (useful for classes with attributes dynamically set).
 ignored-classes=SQLObject
 
-# When zope mode is activated, add a predefined set of Zope acquired attributes
-# to generated-members.
-zope=no
-
 # List of members which are set dynamically and missed by pylint inference
 # system, and so shouldn't trigger E0201 when accessed. Python regular
 # expressions are accepted.
@@ -150,9 +139,6 @@ generated-members=REQUEST,acl_users,aq_parent
 
 [BASIC]
 
-# Required attributes for module, separated by a comma
-required-attributes=
-
 # List of builtins function names that should not be used, separated by a comma
 bad-functions=map,filter,apply,input
 
@@ -231,10 +217,6 @@ max-public-methods=20
 
 [CLASSES]
 
-# List of interface methods to ignore, separated by a comma. This is used for
-# instance to not check methods defines in Zope's Interface base class.
-ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
-
 # List of method names used to declare (i.e. assign) instance attributes.
 defining-attr-methods=__init__,__new__,setUp
 
diff --git a/tests/python/test_authority.py b/tests/python/test_authority.py
index b25816c23c9d5fd943aad4e8f065ab75667db778..e55b9c82ddc53b3cc05455488952a9e80169864e 100644
--- a/tests/python/test_authority.py
+++ b/tests/python/test_authority.py
@@ -19,7 +19,10 @@
 # All rights reserved.
 #
 
-import mock
+try:
+    from unittest import mock
+except ImportError:
+    import mock
 import unittest
 import uuid
 
diff --git a/tox.ini b/tox.ini
index dc75a8b55a93d2f41731d3ffdcb4d712f2f72899..2430a95ee3ac13d1a4035081a4b2c1c08fc52d0d 100644
--- a/tox.ini
+++ b/tox.ini
@@ -19,7 +19,8 @@
 #
 
 [tox]
-envlist = py27,pep8,pep8py3,lint,lint3k,docs
+envlist = py27,py35,pep8,pep8py3,lint,lint3k,docs
+skip_missing_interpreters = true
 
 [testenv]
 # force installation of sphinx and lint in virtual env, otherwise
@@ -51,7 +52,7 @@ commands =
     {envpython} {toxinidir}/scripts/pylint-build-scan.py tox -- --py3k
 
 [testenv:lint3]
-basepython = python3.4
+basepython = python3
 deps =
     pylint
 commands =
@@ -68,7 +69,7 @@ commands =
     flake8 {posargs}
 
 [testenv:pep8py3]
-basepython = python3.4
+basepython = python3
 sitepackages = False
 deps =
     flake8
-- 
2.5.0

