[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/+/2252549
Reviewed-by: Tamer Tas <tmrts@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68492}
This commit is contained in:
Ng Zhi An 2020-06-18 20:38:38 -07:00 committed by Commit Bot
parent 7603a30374
commit 6f296e0b54
3 changed files with 13 additions and 2 deletions

View File

@ -4,6 +4,7 @@
# for py2/py3 compatibility
from __future__ import print_function
from __future__ import absolute_import
import datetime
import json
@ -12,7 +13,7 @@ import platform
import subprocess
import sys
import time
import util
from . import util
from . import base

View File

@ -1,3 +1,4 @@
from __future__ import print_function
# Copyright 2018 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

View File

@ -3,9 +3,18 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from util import FixedSizeTopList
from __future__ import absolute_import
import os
import sys
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):
def test_empty(self):
ofsl = FixedSizeTopList(3)