Verified Commit 6bf2ff64 authored by Peter Stanko's avatar Peter Stanko
Browse files

Simple pylint fixes

parent 77de6498
Loading
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -130,7 +130,8 @@ disable=print-statement,
        # Custom disables
        missing-docstring,
        too-many-ancestors,
        too-many-arguments
        too-many-arguments,
        logging-fstring-interpolation


# Enable the message, report, category or checker with the given id(s). You can
@@ -405,7 +406,7 @@ good-names=i,
           Run,
           _,
           # Custom
           ok, x, y, t, log
           ok, x, y, t, log, ft

# Include a hint for the correct naming format with invalid-name
include-naming-hint=no
+15 −5
Original line number Diff line number Diff line
@@ -8,12 +8,11 @@ from typing import Callable, List, Optional

import requests

from ktdk import log_config
from ktdk import log_config, utils
from ktdk.config import Config
from ktdk.core import Result, Task, Test
from ktdk.runtime import Context
from ktdk.runtime.stat import stat_test
from ktdk.utils import unique_name

log = logging.getLogger(__name__)

@@ -25,18 +24,25 @@ def dump_to_file(context: Context, file_name: str, what):
        file_name(str): File name
        what: What should be written to the file
    """
    file_name = unique_name(file_name, context=context) + ".json"
    file_name = utils.unique_name(file_name, context=context) + ".json"
    context.paths.save_result(file_name, json.dumps(what))


class KTDK(object):
class KTDK:
    """
    Main class of the KTDK, it holds configuration, the suite (root of the )
    """
    instance = None

    @staticmethod
    def get_instance(**cfg):
    def get_instance(**cfg) -> 'KTDK':
        """Gets an instance of the KTDK
        Args:
            **cfg: KTDK config

        Returns(KTDK): KTDK instance

        """
        if KTDK.instance is None:
            log.debug(f"[KTDK] Instance config: {cfg}")
            KTDK.instance = KTDK(**cfg)
@@ -61,6 +67,10 @@ class KTDK(object):
                log.trace(f"[KTDK] Config: {key}={val}")

    def register_tags(self, *tags):
        """Register avail. tags for the suite run
        Args:
            *tags: List of tags
        """
        if 'registered_tags' not in self.config:
            self.config['registered_tags'] = []
        self.config['registered_tags'].extend(tags)
+2 −2
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ class ValgrindPassedCheck(AbstractExecResultMatchesTask):
    def points_multiplier(self):
        if self._points_multiplier:
            return self._points_multiplier
        else:

        return self.context.config['valgrind_penalization'] or 0

    @property
+1 −1
Original line number Diff line number Diff line
@@ -4,9 +4,9 @@ from ktdk.core.tasks import Task
class AbortTask(Task):
    def __init__(self, message: str = None, **kwargs):
        super().__init__(**kwargs)
        self.message = message
        self.desc = self.message or message
        self.name = self.name or 'abort_task'
        self.message = message

    def _run(self, *args, **kwargs):
        self.asserts.abort(self.message)
+1 −1
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ class AbstractXUnitCaseCheck(AbstractMatchesTask):
    def case(self) -> junitparser.TestCase:
        return self.context.config['xunit_case']


class XUnitSuiteFailsCheck(AbstractXUnitSuiteCheck):
    def _run(self, *args, **kwargs):
        self.asserts.check(self.suite.failures, matcher=self.matcher)
@@ -33,4 +34,3 @@ class XUnitSuiteNokCheck(AbstractXUnitSuiteCheck):
class XUnitCaseCheck(AbstractXUnitCaseCheck):
    def _run(self, *args, **kwargs):
        self.asserts.check(self.case.result, matcher=self.matcher)
Loading