Commit 6f296e0b authored by Ng Zhi An's avatar Ng Zhi An Committed by Commit Bot

[Py3] Get tools/testrunner/testproc closer to Py3

This modernizes python code without breaking Py2 compat.

Ran with command:

futurize --stage1 -w tools/testrunner/testpro

Manual fixup to util_unittest to modify import paths and change to
absolute imports.

Bug: v8:9871
Change-Id: I2ac29622aff5daebc9dc42145c1d96dff8258546
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2252549Reviewed-by: 's avatarTamer Tas <tmrts@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68492}
parent 7603a303
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
# for py2/py3 compatibility # for py2/py3 compatibility
from __future__ import print_function from __future__ import print_function
from __future__ import absolute_import
import datetime import datetime
import json import json
...@@ -12,7 +13,7 @@ import platform ...@@ -12,7 +13,7 @@ import platform
import subprocess import subprocess
import sys import sys
import time import time
import util from . import util
from . import base from . import base
......
from __future__ import print_function
# Copyright 2018 the V8 project authors. All rights reserved. # Copyright 2018 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
......
...@@ -3,9 +3,18 @@ ...@@ -3,9 +3,18 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
from util import FixedSizeTopList from __future__ import absolute_import
import os
import sys
import unittest import unittest
TOOLS_PATH = os.path.dirname(os.path.dirname(os.path.dirname(
os.path.abspath(__file__))))
sys.path.append(TOOLS_PATH)
from testrunner.testproc.util import FixedSizeTopList
class TestOrderedFixedSizeList(unittest.TestCase): class TestOrderedFixedSizeList(unittest.TestCase):
def test_empty(self): def test_empty(self):
ofsl = FixedSizeTopList(3) ofsl = FixedSizeTopList(3)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment