[elbe-devel] [PATCH 45/75] junit: Fix Pylint
Torben Hohn
torben.hohn at linutronix.de
Fri May 29 13:07:41 CEST 2020
On Mon, May 25, 2020 at 11:42:38AM -0400, Olivier Dion wrote:
> 14:0: R0205: (useless-object-inheritance)
> 48:12: W0612: (unused-variable)
> 57:0: R0205: (useless-object-inheritance)
> 62:54: E1101: (no-member)
> 70:51: E1101: (no-member)
>
> Signed-off-by: Olivier Dion <dion at linutronix.de>
>
> squash! junit: Fix Pylint
> ---
> elbepack/junit.py | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/elbepack/junit.py b/elbepack/junit.py
> index ab759332..0195701f 100644
> --- a/elbepack/junit.py
> +++ b/elbepack/junit.py
> @@ -10,7 +10,8 @@ import junit_xml as junit
> class TestException(Exception):
> pass
>
> -
> +# TODO:py3 Remove object inheritance
> +# pylint: disable=useless-object-inheritance
> class TestSuite(object):
>
> test_dict = {}
> @@ -45,14 +46,14 @@ class TestSuite(object):
> for test in self.node:
> try:
> test_cases.append(self.do_test(test, self.target))
> - except TestException as E:
> + except TestException:
> pass # TODO - Handle me!
why dont you add "self.tag = None" to BaseTest.__init__() ?
> ts = junit.TestSuite(name=self.node.et.attrib["name"],
> test_cases=test_cases)
> return ts
>
> -
> -#pylint: disable=too-few-public-methods,no-member
> +# TODO:py3 - Remove object inheritance
> +# pylint: disable=useless-object-inheritance
> @TestSuite.register("BaseTest", register=False)
> class BaseTest(object):
>
> @@ -62,6 +63,8 @@ class BaseTest(object):
> self.target = target
>
> def __call__(self):
> + # self.tag is defined in registration
> + # pylint: disable=no-member
> raise TestException("Unimplemented Test %s" % self.tag)
>
>
> @@ -70,6 +73,8 @@ class TestFileExists(BaseTest):
>
> def __call__(self):
> path = self.node.et.text
> + # self.tag is defined in registration
> + # pylint: disable=no-member
> test = junit.TestCase(name=path, classname=self.tag)
> if not self.target.exists(path):
> test.add_failure_info(message="FAILED")
> --
> 2.26.2
>
>
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel
--
Torben Hohn
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99
Hinweise zum Datenschutz finden Sie hier (Informations on data privacy
can be found here): https://linutronix.de/kontakt/Datenschutz.php
Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen |
Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700
806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas Gleixner
More information about the elbe-devel
mailing list