diff options
author | Zhizhou Yang <zhizhouy@google.com> | 2020-02-11 16:56:57 -0800 |
---|---|---|
committer | Zhizhou Yang <zhizhouy@google.com> | 2020-02-13 06:50:19 +0000 |
commit | 43c9066b1889baaa0a6077399deb6a4d503551e6 (patch) | |
tree | db4575b4aea577e3da2d7bfb3ac17f386b257733 /afdo_tools/bisection/afdo_prof_analysis_test.py | |
parent | c4615d189f6b0dc4c116fc0a78ac295f7427170e (diff) | |
download | toolchain-utils-43c9066b1889baaa0a6077399deb6a4d503551e6.tar.gz |
toolchain-utils: migrate all in-use projects to python 3
This patch migrates all in-use projects left to python 3.
BUG=chromium:1011676
TEST=Passed unittests and launched scripts manually.
Change-Id: I7f2de4e1131c05bacfac80667f3064da8adaebfd
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2051397
Reviewed-by: George Burgess <gbiv@chromium.org>
Tested-by: Zhizhou Yang <zhizhouy@google.com>
Auto-Submit: Zhizhou Yang <zhizhouy@google.com>
Diffstat (limited to 'afdo_tools/bisection/afdo_prof_analysis_test.py')
-rwxr-xr-x | afdo_tools/bisection/afdo_prof_analysis_test.py | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/afdo_tools/bisection/afdo_prof_analysis_test.py b/afdo_tools/bisection/afdo_prof_analysis_test.py index 7bd3050c..245edc33 100755 --- a/afdo_tools/bisection/afdo_prof_analysis_test.py +++ b/afdo_tools/bisection/afdo_prof_analysis_test.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2019 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be @@ -8,12 +8,12 @@ from __future__ import print_function -import afdo_prof_analysis as analysis - import random -import StringIO +import io import unittest +from afdo_tools.bisection import afdo_prof_analysis as analysis + class AfdoProfAnalysisTest(unittest.TestCase): """Class for testing AFDO Profile Analysis""" @@ -33,17 +33,17 @@ class AfdoProfAnalysisTest(unittest.TestCase): analysis.random.seed(5) # 5 is an arbitrary choice. For consistent testing def test_text_to_json(self): - test_data = StringIO.StringIO('deflate_slow:87460059:3\n' - ' 3: 24\n' - ' 14: 54767\n' - ' 15: 664 fill_window:22\n' - ' 16: 661\n' - ' 19: 637\n' - ' 41: 36692 longest_match:36863\n' - ' 44: 36692\n' - ' 44.2: 5861\n' - ' 46: 13942\n' - ' 46.1: 14003\n') + test_data = io.StringIO('deflate_slow:87460059:3\n' + ' 3: 24\n' + ' 14: 54767\n' + ' 15: 664 fill_window:22\n' + ' 16: 661\n' + ' 19: 637\n' + ' 41: 36692 longest_match:36863\n' + ' 44: 36692\n' + ' 44.2: 5861\n' + ' 46: 13942\n' + ' 46.1: 14003\n') expected = { 'deflate_slow': ':87460059:3\n' ' 3: 24\n' @@ -115,7 +115,7 @@ class AfdoProfAnalysisTest(unittest.TestCase): self.bad_items, common_funcs, 0, len(common_funcs)) - self.assertEquals(['func_a', 'func_b'], problem_range) + self.assertEqual(['func_a', 'func_b'], problem_range) def test_check_good_not_bad(self): func_in_good = 'func_c' |