bt2: ignore comparison to None flake8 warnings in test_value.py
[babeltrace.git] / tests / bindings / python / bt2 / test_value.py
index b8ecfe55e685b72dd474a6e86967f60c9bf3a5ad..c7cfe0142ba4f929eec5dcd9800e0a2d11adcac4 100644 (file)
@@ -482,10 +482,14 @@ class _TestNumericValue(_TestCopySimple):
         self.assertEqual(str(self._def), str(self._def_value))
 
     def test_eq_none(self):
-        self.assertFalse(self._def == None)
+        # Disable the "comparison to None" warning, as this is precisely what
+        # we want to test here.
+        self.assertFalse(self._def == None)  # noqa: E711
 
     def test_ne_none(self):
-        self.assertTrue(self._def != None)
+        # Disable the "comparison to None" warning, as this is precisely what
+        # we want to test here.
+        self.assertTrue(self._def != None)  # noqa: E711
 
 
 # This is a list of binary operators used for
@@ -1174,10 +1178,14 @@ class BoolValueTestCase(_TestNumericValue, unittest.TestCase):
         self.assertEqual(str(self._def), str(self._def_value))
 
     def test_eq_none(self):
-        self.assertFalse(self._def == None)
+        # Disable the "comparison to None" warning, as this is precisely what
+        # we want to test here.
+        self.assertFalse(self._def == None)  # noqa: E711
 
     def test_ne_none(self):
-        self.assertTrue(self._def != None)
+        # Disable the "comparison to None" warning, as this is precisely what
+        # we want to test here.
+        self.assertTrue(self._def != None)  # noqa: E711
 
     def test_vfalse_eq_false(self):
         self.assertEqual(self._f, False)
@@ -1363,10 +1371,6 @@ class RealValueTestCase(_TestNumericValue, unittest.TestCase):
     def test_create_neg(self):
         self.assertEqual(self._fn, self._nv)
 
-    def test_create_from_vint(self):
-        f = bt2.RealValue(self._fp)
-        self.assertEqual(f, self._pv)
-
     def test_create_from_false(self):
         f = bt2.RealValue(False)
         self.assertFalse(f)
@@ -1691,10 +1695,6 @@ class ArrayValueTestCase(_TestCopySimple, unittest.TestCase):
         self._def[2] = None
         self.assertIsNone(self._def[2])
 
-    def test_setitem_none(self):
-        self._def[2] = None
-        self.assertIsNone(self._def[2])
-
     def test_setitem_index_wrong_type(self):
         with self._assert_type_error():
             self._def['yes'] = 23
@@ -1960,3 +1960,7 @@ class MapValueTestCase(_TestCopySimple, unittest.TestCase):
     def test_getitem_wrong_key(self):
         with self.assertRaises(KeyError):
             self._def['kilojoule']
+
+
+if __name__ == '__main__':
+    unittest.main()
This page took 0.023637 seconds and 4 git commands to generate.