Bug 1406666 - Add testing/*cppun*.py to the list of flake8 compliant code r=ahal

MozReview-Commit-ID: KWsXMRgy4XG

--HG--
extra : rebase_source : b6e82fcd6f5dfb9f823ac5d00c623387b7e95632
This commit is contained in:
Sylvestre Ledru 2017-10-07 19:45:12 +02:00
Родитель 7cb2262b1e
Коммит 61e0724a88
3 изменённых файлов: 20 добавлений и 7 удалений

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

@ -180,7 +180,8 @@ class RemoteCPPUnittestOptions(cppunittests.CPPUnittestOptions):
self.add_option("--noSetup", action="store_false",
dest="setup",
help="do not copy any files to device (to be used only if device is already setup)")
help="do not copy any files to device (to be used only if "
"device is already setup)")
defaults["setup"] = True
self.add_option("--localLib", action="store",
@ -213,7 +214,8 @@ class RemoteCPPUnittestOptions(cppunittests.CPPUnittestOptions):
help="Architecture of emulator to use: x86 or arm")
self.add_option("--addEnv", action="append",
type="string", dest="add_env",
help="additional remote environment variable definitions (eg. --addEnv \"somevar=something\")")
help="additional remote environment variable definitions "
"(eg. --addEnv \"somevar=something\")")
defaults["add_env"] = None
self.set_defaults(**defaults)
@ -237,7 +239,7 @@ def run_test_harness(options, args):
dm_args['host'] = options.device_ip
dm_args['port'] = options.device_port
if options.log_tbpl_level == 'debug' or options.log_mach_level == 'debug':
dm_args['logLevel'] = logging.DEBUG
dm_args['logLevel'] = logging.DEBUG # noqa python 2 / 3
dm = devicemanagerADB.DeviceManagerADB(**dm_args)
except:
if options.with_b2g_emulator:

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

@ -95,7 +95,8 @@ class CPPUnitTests(object):
def build_environment(self):
"""
Create and return a dictionary of all the appropriate env variables and values.
On a remote system, we overload this to set different values and are missing things like os.environ and PATH.
On a remote system, we overload this to set different values and are missing things
like os.environ and PATH.
"""
if not os.path.isdir(self.xre_path):
raise Exception("xre_path does not exist: %s", self.xre_path)
@ -185,7 +186,8 @@ class CPPUnittestOptions(OptionParser):
self.add_option("--symbols-path",
action="store", type="string", dest="symbols_path",
default=None,
help="absolute path to directory containing breakpad symbols, or the URL of a zip file containing symbols")
help="absolute path to directory containing breakpad symbols, or "
"the URL of a zip file containing symbols")
self.add_option("--manifest-path",
action="store", type="string", dest="manifest_path",
default=None,
@ -218,9 +220,16 @@ def extract_unittests_from_args(args, environ, manifest_path):
active_tests = mp.active_tests(exists=False, disabled=False, **environ)
suffix = '.exe' if mozinfo.isWin else ''
if binary_path:
tests.extend([(os.path.join(binary_path, test['relpath'] + suffix), int(test.get('requesttimeoutfactor', 1))) for test in active_tests])
tests.extend([
(os.path.join(binary_path, test['relpath'] + suffix),
int(test.get('requesttimeoutfactor', 1)))
for test in active_tests])
else:
tests.extend([(test['path'] + suffix, int(test.get('requesttimeoutfactor', 1))) for test in active_tests])
tests.extend([
(test['path'] + suffix,
int(test.get('requesttimeoutfactor', 1)))
for test in active_tests
])
# skip non-existing tests
tests = [test for test in tests if os.path.isfile(test[0])]

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

@ -17,6 +17,8 @@ flake8:
- testing/marionette/puppeteer
- testing/mozbase
- testing/mochitest
- testing/remotecppunittests.py
- testing/runcppunittests.py
- testing/talos/
- testing/xpcshell
- tools/git