aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRahul Chaudhry <rahulchaudhry@chromium.org>2016-01-15 15:16:47 -0800
committerchrome-bot <chrome-bot@chromium.org>2016-01-23 06:14:43 +0000
commite7c6fbf9cfd5f45dda21f2c4742bf5a62589d2ed (patch)
tree97ff3716674fedb66952ad6e7e9a4bc602d2af30
parente57523abd8f2a5aa0b93f1248d6d969d0865781b (diff)
downloadtoolchain-utils-e7c6fbf9cfd5f45dda21f2c4742bf5a62589d2ed.tar.gz
toolchain-utils: fix class-missing-docstring lint warnings.
BUG=chromium:570458 TEST='crosperf/run_tests.sh' passes. Change-Id: I0640cab2c8d15380badbfbc0db39e3063cc85471 Reviewed-on: https://chrome-internal-review.googlesource.com/244867 Commit-Ready: Rahul Chaudhry <rahulchaudhry@google.com> Tested-by: Rahul Chaudhry <rahulchaudhry@google.com> Reviewed-by: Luis Lozano <llozano@chromium.org>
-rwxr-xr-xbinary_search_tool/test/binary_search_tool_tester.py1
-rwxr-xr-xcrosperf/crosperf.py1
-rwxr-xr-xcrosperf/experiment_runner_unittest.py2
-rwxr-xr-xcrosperf/machine_manager_unittest.py3
-rw-r--r--crosperf/suite_runner.py1
-rwxr-xr-xutils/buildbot_json.py6
-rwxr-xr-xutils/command_executer_unittest.py1
-rw-r--r--utils/misc_test.py1
-rw-r--r--utils/no_pseudo_terminal_test.py1
-rwxr-xr-xutils/perf_diff.py3
-rw-r--r--utils/tabulator.py15
-rw-r--r--utils/tabulator_test.py1
-rw-r--r--utils/timeline.py1
-rw-r--r--utils/timeline_test.py1
14 files changed, 38 insertions, 0 deletions
diff --git a/binary_search_tool/test/binary_search_tool_tester.py b/binary_search_tool/test/binary_search_tool_tester.py
index 72816790..45ce0642 100755
--- a/binary_search_tool/test/binary_search_tool_tester.py
+++ b/binary_search_tool/test/binary_search_tool_tester.py
@@ -20,6 +20,7 @@ import gen_obj
class BisectingUtilsTest(unittest.TestCase):
+ """Tests for bisecting tool."""
def setUp(self):
"""Generate [100-1000] object files, and 1-5% of which are bad ones."""
diff --git a/crosperf/crosperf.py b/crosperf/crosperf.py
index cc2c9010..9f8edc0e 100755
--- a/crosperf/crosperf.py
+++ b/crosperf/crosperf.py
@@ -22,6 +22,7 @@ import test_flag
class MyIndentedHelpFormatter(optparse.IndentedHelpFormatter):
+ """Help formatter."""
def format_description(self, description):
return description
diff --git a/crosperf/experiment_runner_unittest.py b/crosperf/experiment_runner_unittest.py
index 2fc512d9..3502ce60 100755
--- a/crosperf/experiment_runner_unittest.py
+++ b/crosperf/experiment_runner_unittest.py
@@ -48,6 +48,7 @@ EXPERIMENT_FILE_1 = """
class FakeLogger(object):
+ """Fake logger for tests."""
def __init__(self):
self.LogOutputCount = 0
@@ -90,6 +91,7 @@ class FakeLogger(object):
class ExperimentRunnerTest(unittest.TestCase):
+ """Test for experiment runner class."""
run_counter = 0
mock_logger = FakeLogger()
diff --git a/crosperf/machine_manager_unittest.py b/crosperf/machine_manager_unittest.py
index 8032e53b..0103ecdc 100755
--- a/crosperf/machine_manager_unittest.py
+++ b/crosperf/machine_manager_unittest.py
@@ -25,6 +25,7 @@ from cros_utils import logger
class MyMachineManager(machine_manager.MachineManager):
+ """Machine manager for test."""
def __init__(self, chromeos_root):
super(MyMachineManager, self).__init__(chromeos_root, 0, 'average',
@@ -57,6 +58,7 @@ LABEL_MIX = label.MockLabel('mix', 'chromeos_image', CHROMEOS_ROOT, 'mix',
class MachineManagerTest(unittest.TestCase):
+ """Test for machine manager class."""
mock_cmd_exec = mock.Mock(spec=command_executer.CommandExecuter)
@@ -653,6 +655,7 @@ wlan0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
class CrosMachineTest(unittest.TestCase):
+ """Test for CrosMachine class."""
mock_cmd_exec = mock.Mock(spec=command_executer.CommandExecuter)
diff --git a/crosperf/suite_runner.py b/crosperf/suite_runner.py
index b75427f2..622e3395 100644
--- a/crosperf/suite_runner.py
+++ b/crosperf/suite_runner.py
@@ -271,6 +271,7 @@ class SuiteRunner(object):
class MockSuiteRunner(object):
+ """Mock suite runner for test."""
def __init__(self):
self._true = True
diff --git a/utils/buildbot_json.py b/utils/buildbot_json.py
index 11ae3093..d96988db 100755
--- a/utils/buildbot_json.py
+++ b/utils/buildbot_json.py
@@ -524,6 +524,7 @@ class SubViewNodeList(VirtualNodeList): # pylint: disable=W0223
class Slave(AddressableDataNode):
+ """Buildbot slave class."""
printable_attributes = AddressableDataNode.printable_attributes + [
'name',
'key',
@@ -548,6 +549,7 @@ class Slave(AddressableDataNode):
class Slaves(AddressableNodeList):
+ """Buildbot slaves."""
_child_cls = Slave
printable_attributes = AddressableNodeList.printable_attributes + ['names']
@@ -573,6 +575,7 @@ class BuilderSlaves(SubViewNodeList):
class BuildStep(NonAddressableDataNode):
+ """Class for a buildbot build step."""
printable_attributes = NonAddressableDataNode.printable_attributes + [
'name',
'number',
@@ -683,6 +686,7 @@ class BuildSteps(NonAddressableNodeList):
class Build(AddressableDataNode):
+ """Buildbot build info."""
printable_attributes = AddressableDataNode.printable_attributes + [
'key',
'number',
@@ -799,6 +803,7 @@ class CurrentBuilds(SubViewNodeList):
class PendingBuilds(AddressableDataNode):
+ """List of the pending builds."""
def __init__(self, parent):
super(PendingBuilds, self).__init__(parent, 'pendingBuilds', None)
@@ -879,6 +884,7 @@ class Builds(AddressableNodeList):
class Builder(AddressableDataNode):
+ """Builder status."""
printable_attributes = AddressableDataNode.printable_attributes + [
'name',
'key',
diff --git a/utils/command_executer_unittest.py b/utils/command_executer_unittest.py
index 6922febe..d5f5d0cf 100755
--- a/utils/command_executer_unittest.py
+++ b/utils/command_executer_unittest.py
@@ -10,6 +10,7 @@ import command_executer
class CommandExecuterTest(unittest.TestCase):
+ """Test for CommandExecuter class."""
def testTimeout(self):
timeout = 1
diff --git a/utils/misc_test.py b/utils/misc_test.py
index 418068bf..dbc42563 100644
--- a/utils/misc_test.py
+++ b/utils/misc_test.py
@@ -13,6 +13,7 @@ import misc
class UtilsTest(unittest.TestCase):
+ """Tests for misc."""
def testGetFilenameFromString(self):
string = 'a /b=c"d^$?\\'
diff --git a/utils/no_pseudo_terminal_test.py b/utils/no_pseudo_terminal_test.py
index fd349e87..0290e40e 100644
--- a/utils/no_pseudo_terminal_test.py
+++ b/utils/no_pseudo_terminal_test.py
@@ -11,6 +11,7 @@ from utils import command_executer
class NoPsuedoTerminalTest(unittest.TestCase):
+ """Test to ensure we're not touching /dev/ptmx when running commands."""
STRACE_TIMEOUT = 10
diff --git a/utils/perf_diff.py b/utils/perf_diff.py
index 3e390b2c..a19470d9 100755
--- a/utils/perf_diff.py
+++ b/utils/perf_diff.py
@@ -52,6 +52,7 @@ def _SortDictionaryByValue(d):
class Tabulator(object):
+ """Make tables."""
def __init__(self, all_dicts):
self._all_dicts = all_dicts
@@ -91,6 +92,7 @@ class Tabulator(object):
class Function(object):
+ """Function for formatting."""
def __init__(self):
self.count = 0
@@ -99,6 +101,7 @@ class Function(object):
class Section(object):
+ """Section formatting."""
def __init__(self, contents):
self.raw_contents = contents
diff --git a/utils/tabulator.py b/utils/tabulator.py
index 78c84f5d..88345fa1 100644
--- a/utils/tabulator.py
+++ b/utils/tabulator.py
@@ -287,6 +287,7 @@ class Result(object):
class LiteralResult(Result):
+ """A literal result."""
def __init__(self, iteration=0):
super(LiteralResult, self).__init__()
@@ -330,6 +331,7 @@ class NonEmptyCountResult(Result):
class StringMeanResult(Result):
+ """Mean of string values."""
def _ComputeString(self, cell, values, baseline_values):
if self._AllStringsSame(values):
@@ -339,16 +341,19 @@ class StringMeanResult(Result):
class AmeanResult(StringMeanResult):
+ """Arithmetic mean."""
def _ComputeFloat(self, cell, values, baseline_values):
cell.value = numpy.mean(values)
class RawResult(Result):
+ """Raw result."""
pass
class MinResult(Result):
+ """Minimum."""
def _ComputeFloat(self, cell, values, baseline_values):
cell.value = min(values)
@@ -361,6 +366,7 @@ class MinResult(Result):
class MaxResult(Result):
+ """Maximum."""
def _ComputeFloat(self, cell, values, baseline_values):
cell.value = max(values)
@@ -373,18 +379,21 @@ class MaxResult(Result):
class NumericalResult(Result):
+ """Numerical result."""
def _ComputeString(self, cell, values, baseline_values):
cell.value = '?'
class StdResult(NumericalResult):
+ """Standard deviation."""
def _ComputeFloat(self, cell, values, baseline_values):
cell.value = numpy.std(values)
class CoeffVarResult(NumericalResult):
+ """Standard deviation / Mean"""
def _ComputeFloat(self, cell, values, baseline_values):
if numpy.mean(values) != 0.0:
@@ -395,6 +404,7 @@ class CoeffVarResult(NumericalResult):
class ComparisonResult(Result):
+ """Same or Different."""
def NeedsBaseline(self):
return True
@@ -416,6 +426,7 @@ class ComparisonResult(Result):
class PValueResult(ComparisonResult):
+ """P-value."""
def _ComputeFloat(self, cell, values, baseline_values):
if len(values) < 2 or len(baseline_values) < 2:
@@ -429,6 +440,7 @@ class PValueResult(ComparisonResult):
class KeyAwareComparisonResult(ComparisonResult):
+ """Automatic key aware comparison."""
def _IsLowerBetter(self, key):
# TODO(llozano): Trying to guess direction by looking at the name of the
@@ -468,6 +480,7 @@ class KeyAwareComparisonResult(ComparisonResult):
class AmeanRatioResult(KeyAwareComparisonResult):
+ """Ratio of arithmetic means of values vs. baseline values."""
def _ComputeFloat(self, cell, values, baseline_values):
if numpy.mean(baseline_values) != 0:
@@ -481,6 +494,7 @@ class AmeanRatioResult(KeyAwareComparisonResult):
class GmeanRatioResult(KeyAwareComparisonResult):
+ """Ratio of geometric means of values vs. baseline values."""
def _ComputeFloat(self, cell, values, baseline_values):
if self._GetGmean(baseline_values) != 0:
@@ -589,6 +603,7 @@ class Format(object):
class PValueFormat(Format):
+ """Formatting for p-value."""
def _ComputeFloat(self, cell):
cell.string_value = '%0.2f' % float(cell.value)
diff --git a/utils/tabulator_test.py b/utils/tabulator_test.py
index 461c2877..4d15fdc8 100644
--- a/utils/tabulator_test.py
+++ b/utils/tabulator_test.py
@@ -13,6 +13,7 @@ import tabulator
class TabulatorTest(unittest.TestCase):
+ """Tests for the Tabulator class."""
def testResult(self):
table = ['k1', ['1', '3'], ['55']]
diff --git a/utils/timeline.py b/utils/timeline.py
index 84c8be85..873aaa30 100644
--- a/utils/timeline.py
+++ b/utils/timeline.py
@@ -10,6 +10,7 @@ import time
class Event(object):
+ """One event on the timeline."""
def __init__(self, name='', cur_time=0):
self.name = name
diff --git a/utils/timeline_test.py b/utils/timeline_test.py
index 866d119c..c93a1274 100644
--- a/utils/timeline_test.py
+++ b/utils/timeline_test.py
@@ -12,6 +12,7 @@ import timeline
class TimeLineTest(unittest.TestCase):
+ """Tests for the Timeline class."""
def testRecord(self):
tl = timeline.Timeline()