[PATCH 06/13] trivial: noqa any 'assert' functions

Stephen Finucane stephenfinucane at hotmail.com
Tue Sep 20 08:38:54 AEST 2016


There are advantages to sticking with unittest's use of camel case in
function names, but some code tools don't like this. noqa these lines
to hide the warnings.

Signed-off-by: Stephen Finucane <stephenfinucane at hotmail.com>
---
 patchwork/tests/test_checks.py | 6 +++---
 patchwork/tests/test_parser.py | 4 ++--
 patchwork/tests/test_tags.py   | 6 +++---
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/patchwork/tests/test_checks.py b/patchwork/tests/test_checks.py
index cb3dfcc..c0487f3 100644
--- a/patchwork/tests/test_checks.py
+++ b/patchwork/tests/test_checks.py
@@ -43,12 +43,12 @@ class PatchChecksTest(TransactionTestCase):
 
         return create_check(**values)
 
-    def assertCheckEqual(self, patch, check_state):
+    def assertCheckEqual(self, patch, check_state):  # noqa
         state_names = dict(Check.STATE_CHOICES)
         self.assertEqual(self.patch.combined_check_state,
                          state_names[check_state])
 
-    def assertChecksEqual(self, patch, checks=None):
+    def assertChecksEqual(self, patch, checks=None):  # noqa
         if not checks:
             checks = []
 
@@ -57,7 +57,7 @@ class PatchChecksTest(TransactionTestCase):
             sorted(self.patch.checks, key=lambda check: check.id),
             sorted(checks, key=lambda check: check.id))
 
-    def assertCheckCountEqual(self, patch, total, state_counts=None):
+    def assertCheckCountEqual(self, patch, total, state_counts=None):  # noqa
         if not state_counts:
             state_counts = {}
 
diff --git a/patchwork/tests/test_parser.py b/patchwork/tests/test_parser.py
index 7b5c71b..9a739e4 100644
--- a/patchwork/tests/test_parser.py
+++ b/patchwork/tests/test_parser.py
@@ -554,7 +554,7 @@ class DelegateRequestTest(TestCase):
         email['Message-Id'] = self.msgid
         return email
 
-    def assertDelegate(self, delegate):
+    def assertDelegate(self, delegate):  # noqa
         query = Patch.objects.filter(project=self.project)
         self.assertEqual(query.count(), 1)
         self.assertEqual(query[0].delegate, delegate)
@@ -596,7 +596,7 @@ class InitialPatchStateTest(TestCase):
             self.patch, msgid=self.msgid, listid='<%s>' % self.project.listid)
         return email
 
-    def assertState(self, state):
+    def assertState(self, state):  # noqa
         query = Patch.objects.filter(project=self.project)
         self.assertEqual(query.count(), 1)
         self.assertEqual(query[0].state, state)
diff --git a/patchwork/tests/test_tags.py b/patchwork/tests/test_tags.py
index 7d200e3..4fd1bf2 100644
--- a/patchwork/tests/test_tags.py
+++ b/patchwork/tests/test_tags.py
@@ -33,7 +33,7 @@ class ExtractTagsTest(TestCase):
     email = 'test at example.com'
     name_email = 'test name <' + email + '>'
 
-    def assertTagsEqual(self, str, acks, reviews, tests):
+    def assertTagsEqual(self, str, acks, reviews, tests):  # noqa
         counts = Patch.extract_tags(str, Tag.objects.all())
         self.assertEqual((acks, reviews, tests),
                          (counts[Tag.objects.get(name='Acked-by')],
@@ -92,7 +92,7 @@ class PatchTagsTest(TransactionTestCase):
         self.patch.project.use_tags = True
         self.patch.project.save()
 
-    def assertTagsEqual(self, patch, acks, reviews, tests):
+    def assertTagsEqual(self, patch, acks, reviews, tests):  # noqa
         patch = Patch.objects.get(pk=patch.pk)
 
         def count(name):
@@ -183,7 +183,7 @@ class PatchTagsTest(TransactionTestCase):
 
 class PatchTagManagerTest(PatchTagsTest):
 
-    def assertTagsEqual(self, patch, acks, reviews, tests):
+    def assertTagsEqual(self, patch, acks, reviews, tests):  # noqa
         tagattrs = {}
         for tag in Tag.objects.all():
             tagattrs[tag.name] = tag.attr_name
-- 
2.7.4



More information about the Patchwork mailing list