Enable py36 unit tests 69/68269/1
authorCédric Ollivier <cedric.ollivier@orange.com>
Fri, 26 Jul 2019 10:58:04 +0000 (12:58 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Sat, 27 Jul 2019 11:08:15 +0000 (13:08 +0200)
It benefits from the swith to lf-virtual1.

Change-Id: I9f99f24a5e3c8ef6374e049d7117aa7d5aa4d442
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
.travis.yml
test-requirements.txt
tox.ini
upper-constraints.txt
xtesting/tests/unit/core/test_feature.py
xtesting/tests/unit/core/test_testcase.py
xtesting/tests/unit/energy/test_functest_energy.py

index 1ffc4c2..7252482 100644 (file)
@@ -5,7 +5,7 @@ language: generic
 
 before_script:
   - sudo apt-get -y install qemu-user-static
-  - sudo add-apt-repository -y ppa:jonathonf/python-3.6
+  - sudo add-apt-repository -y ppa:deadsnakes/ppa
   - sudo apt-get update
   - sudo apt-get install python3.6 python3.6-dev
   - sudo pip install tox
index 08f0807..ef2ef20 100644 (file)
@@ -5,7 +5,7 @@ coverage!=4.4 # Apache-2.0
 mock # BSD
 nose # LGPL
 flake8<2.6.0,>=2.5.4 # MIT
-pylint==1.4.5 # GPLv2
+pylint # GPLv2
 sphinx!=1.6.6,!=1.6.7,<2.0.0;python_version=='2.7' # BSD
 sphinx!=1.6.6,!=1.6.7;python_version>='3.4' # BSD
 sphinx-rtd-theme
diff --git a/tox.ini b/tox.ini
index 1dedf98..2249a59 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
 [tox]
-envlist = docs,pep8,pylint,yamllint,ansiblelint,bashate,py27,perm,cover
+envlist = docs,pep8,pylint,yamllint,ansiblelint,bashate,py27,py36,cover
 skipsdist = True
 
 [testenv]
index 3bfdf03..1e03562 100644 (file)
@@ -1,2 +1,4 @@
 robotframework===3.0.2
 bandit===1.1.0
+pylint===1.9.5;python_version=='2.7'
+pylint===2.3.1;python_version=='3.6'
index 3067879..785f6e1 100644 (file)
@@ -29,6 +29,7 @@ class FakeTestCase(feature.Feature):
 class AbstractFeatureTesting(unittest.TestCase):
 
     def test_run_unimplemented(self):
+        # pylint: disable=abstract-class-instantiated
         with self.assertRaises(TypeError):
             feature.Feature(case_name="feature", project_name="xtesting")
 
index 51ea6f3..fc61297 100644 (file)
@@ -35,6 +35,7 @@ class FakeTestCase(testcase.TestCase):
 class AbstractTestCaseTesting(unittest.TestCase):
 
     def test_run_unimplemented(self):
+        # pylint: disable=abstract-class-instantiated
         with self.assertRaises(TypeError):
             testcase.TestCase(case_name="base", project_name="xtesting")
 
index ea83c1e..826e0d9 100644 (file)
@@ -287,11 +287,11 @@ class EnergyRecorderTest(unittest.TestCase):
         EnergyRecorder.energy_recorder_api = None
         EnergyRecorder.load_config()
 
-        self.assertEquals(
+        self.assertEqual(
             EnergyRecorder.energy_recorder_api["auth"],
             ("user", "password")
         )
-        self.assertEquals(
+        self.assertEqual(
             EnergyRecorder.energy_recorder_api["uri"],
             "http://pod-uri:8888/recorders/environment/MOCK_POD"
         )
@@ -304,8 +304,8 @@ class EnergyRecorderTest(unittest.TestCase):
         self._set_env_nocreds()
         EnergyRecorder.energy_recorder_api = None
         EnergyRecorder.load_config()
-        self.assertEquals(EnergyRecorder.energy_recorder_api["auth"], None)
-        self.assertEquals(
+        self.assertEqual(EnergyRecorder.energy_recorder_api["auth"], None)
+        self.assertEqual(
             EnergyRecorder.energy_recorder_api["uri"],
             "http://pod-uri:8888/recorders/environment/MOCK_POD"
         )
@@ -319,7 +319,7 @@ class EnergyRecorderTest(unittest.TestCase):
             with self.assertRaises(AssertionError):
                 EnergyRecorder.energy_recorder_api = None
                 EnergyRecorder.load_config()
-            self.assertEquals(EnergyRecorder.energy_recorder_api, None)
+            self.assertEqual(EnergyRecorder.energy_recorder_api, None)
 
     @mock.patch("xtesting.energy.energy.requests.get",
                 return_value=API_KO)
@@ -329,8 +329,8 @@ class EnergyRecorderTest(unittest.TestCase):
         self._set_env_creds()
         EnergyRecorder.energy_recorder_api = None
         EnergyRecorder.load_config()
-        self.assertEquals(EnergyRecorder.energy_recorder_api["available"],
-                          False)
+        self.assertEqual(EnergyRecorder.energy_recorder_api["available"],
+                         False)
 
     @mock.patch('xtesting.energy.energy.requests.get',
                 return_value=RECORDER_OK)