diff options
author | Denis Nikitin <denik@google.com> | 2019-09-23 18:43:37 -0700 |
---|---|---|
committer | Denis Nikitin <denik@chromium.org> | 2019-09-24 22:39:59 +0000 |
commit | 5aa82413d43af9a6aa18ce53d7a618bca0acb9df (patch) | |
tree | ddc85c08923a928101bfb5ebaeaa55de76029933 /crosperf/schedv2_unittest.py | |
parent | 4d72583ef73e8c3bf7a1ae9dd016ef7aeed09fed (diff) | |
download | toolchain-utils-5aa82413d43af9a6aa18ce53d7a618bca0acb9df.tar.gz |
crosperf: Fix cros lint warnings
Fixed python lint warnings in crosperf scripts.
BUG=chromium:993035
TEST=`repo upload` works w/o --no-verify
Change-Id: I3dd7b0ea956458e57e8bd77c19a5b8cb13e1d350
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1821449
Tested-by: Denis Nikitin <denik@chromium.org>
Reviewed-by: George Burgess <gbiv@chromium.org>
Diffstat (limited to 'crosperf/schedv2_unittest.py')
-rwxr-xr-x | crosperf/schedv2_unittest.py | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/crosperf/schedv2_unittest.py b/crosperf/schedv2_unittest.py index 250968dc..4aced646 100755 --- a/crosperf/schedv2_unittest.py +++ b/crosperf/schedv2_unittest.py @@ -1,13 +1,19 @@ #!/usr/bin/env python2 +# -*- coding: utf-8 -*- + +# Copyright 2015 The Chromium OS Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. -# Copyright 2015 Google Inc. All Rights Reserved. """This contains the unit tests for the new Crosperf task scheduler.""" from __future__ import print_function -import mock +import functools +import io import unittest -import StringIO + +import mock import benchmark_run import test_flag @@ -73,7 +79,7 @@ class Schedv2Test(unittest.TestCase): Note - we mock out BenchmarkRun in this step. """ - experiment_file = ExperimentFile(StringIO.StringIO(expstr)) + experiment_file = ExperimentFile(io.BytesIO(expstr)) experiment = ExperimentFactory().GetExperiment( experiment_file, working_directory='', log_dir='') return experiment @@ -191,8 +197,8 @@ class Schedv2Test(unittest.TestCase): self.assertEquals(len(my_schedv2.get_cached_run_list()), 30) # The non-cache-hit brs are put into Schedv2._label_brl_map. self.assertEquals( - reduce(lambda a, x: a + len(x[1]), - my_schedv2.get_label_map().iteritems(), 0), 30) + functools.reduce(lambda a, x: a + len(x[1]), + my_schedv2.get_label_map().iteritems(), 0), 30) def test_nocachehit(self): """Test no cache-hit.""" @@ -209,8 +215,8 @@ class Schedv2Test(unittest.TestCase): self.assertEquals(len(my_schedv2.get_cached_run_list()), 0) # The non-cache-hit brs are put into Schedv2._label_brl_map. self.assertEquals( - reduce(lambda a, x: a + len(x[1]), - my_schedv2.get_label_map().iteritems(), 0), 60) + functools.reduce(lambda a, x: a + len(x[1]), + my_schedv2.get_label_map().iteritems(), 0), 60) if __name__ == '__main__': |