Bug 1397855 - Enable py2 and py3 linter on testing/xpcshell. r=ahal

MozReview-Commit-ID: CsfIcI1ma7J

--HG--
extra : rebase_source : 1cdb7a848813a4a4872005095550b74c13ebecdf
This commit is contained in:
Steve Armand 2017-09-07 21:15:35 -04:00
Родитель 8eb1dc621f
Коммит d4bfc7402c
6 изменённых файлов: 14 добавлений и 7 удалений

Просмотреть файл

@ -2,7 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import unicode_literals
from __future__ import absolute_import, unicode_literals
import os
import sys

Просмотреть файл

@ -4,6 +4,8 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import, print_function
import logging
import posixpath
import sys, os
@ -168,7 +170,7 @@ class RemoteXPCShellTestThread(xpcshell.XPCShellTestThread):
# The minidumps directory is automatically created when Fennec
# (first) starts, so its lack of presence is a hint that
# something went wrong.
print "Automation Error: No crash directory (%s) found on remote device" % self.remoteMinidumpDir
print("Automation Error: No crash directory (%s) found on remote device" % self.remoteMinidumpDir)
# Whilst no crash was found, the run should still display as a failure
return True
with mozfile.TemporaryDirectory() as dumpDir:
@ -375,7 +377,7 @@ class XPCShellRemote(xpcshell.XPCShellTests, object):
if packageName:
self.appRoot = self.device.getAppRoot(packageName.strip())
except Exception as detail:
print "unable to determine app root: " + str(detail)
print("unable to determine app root: " + str(detail))
pass
return None
@ -494,7 +496,7 @@ class XPCShellRemote(xpcshell.XPCShellTests, object):
self.device.pushDir(self.testingModulesDir, self.remoteModulesDir)
def setupTestDir(self):
print 'pushing %s' % self.xpcDir
print('pushing %s' % self.xpcDir)
try:
# The tests directory can be quite large: 5000 files and growing!
# Sometimes - like on a low-end aws instance running an emulator - the push

Просмотреть файл

@ -4,6 +4,8 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import, print_function
import copy
import importlib
import json
@ -1068,7 +1070,7 @@ class XPCShellTests(object):
searchObj = re.search( r'HTTP2 server listening on port (.*)', msg, 0)
if searchObj:
self.env["MOZHTTP2_PORT"] = searchObj.group(1)
except OSError, e:
except OSError as e:
# This occurs if the subprocess couldn't be started
self.log.error('Could not run %s server: %s' % (name, str(e)))
raise

Просмотреть файл

@ -4,6 +4,8 @@
# http://creativecommons.org/publicdomain/zero/1.0/
#
from __future__ import absolute_import
import mozinfo
import mozunit
import os
@ -1084,7 +1086,7 @@ add_test({
try:
# The actual return value is never checked because we raise.
self.assertTestResult(True)
except Exception, ex:
except Exception as ex:
raised = True
self.assertEquals(ex.message[0:9], "head file")

Просмотреть файл

@ -1,3 +1,5 @@
from __future__ import absolute_import
import argparse
from mozlog import commandline

Просмотреть файл

@ -51,7 +51,6 @@ py2:
- testing/tools
- testing/tps
- testing/web-platform
- testing/xpcshell
- third_party
- toolkit
- tools/docs