Bug 1790816 - Reformat testing/ with isort. r=linter-reviewers,webdriver-reviewers,perftest-reviewers,jgraham,gbrown,whimboo,sparky,ahal

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D162657
This commit is contained in:
Marco Castelluccio 2022-12-21 14:38:37 +00:00
Родитель 9c8943cad4
Коммит 8f59316975
497 изменённых файлов: 1023 добавлений и 1121 удалений

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

@ -1,7 +1,8 @@
from __future__ import absolute_import, unicode_literals, print_function
from __future__ import absolute_import, print_function, unicode_literals
import io
import os
import manifestparser

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

@ -17,7 +17,6 @@ import tempfile
import time
import mozlog.structured
from marionette_driver import Wait
from marionette_driver.errors import JavascriptException, ScriptTimeoutException
from marionette_driver.keys import Keys
@ -27,8 +26,13 @@ AWSY_PATH = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
if AWSY_PATH not in sys.path:
sys.path.append(AWSY_PATH)
from awsy import ITERATIONS, PER_TAB_PAUSE, SETTLE_WAIT_TIME, MAX_TABS
from awsy import process_perf_data
from awsy import (
ITERATIONS,
MAX_TABS,
PER_TAB_PAUSE,
SETTLE_WAIT_TIME,
process_perf_data,
)
class AwsyTestCase(MarionetteTestCase):

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

@ -10,9 +10,9 @@
from __future__ import absolute_import, print_function
import argparse
from collections import defaultdict
import gzip
import json
from collections import defaultdict
# This value comes from nsIMemoryReporter.idl.
KIND_HEAP = 1

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

@ -5,12 +5,13 @@
from __future__ import absolute_import, division, print_function
import six
import os
import sys
import glob
import json
import math
import glob
import os
import sys
import six
AWSY_PATH = os.path.dirname(os.path.realpath(__file__))
if AWSY_PATH not in sys.path:

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

@ -6,10 +6,9 @@ from __future__ import absolute_import
import os
import sys
import yaml
import mozinfo
import yaml
from marionette_driver.errors import JavascriptException, ScriptTimeoutException
from mozproxy import get_playback

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

@ -15,7 +15,6 @@ import socket
import mozhttpd
# directory of this file
here = os.path.dirname(os.path.realpath(__file__))

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

@ -9,20 +9,11 @@ import logging
import os
import sys
import six
from mozbuild.base import (
MachCommandConditions as conditions,
BinaryNotFoundException,
)
from mach.decorators import (
CommandArgument,
CommandArgumentGroup,
Command,
)
import mozinfo
import six
from mach.decorators import Command, CommandArgument, CommandArgumentGroup
from mozbuild.base import BinaryNotFoundException
from mozbuild.base import MachCommandConditions as conditions
def setup_awsy_argument_parser():
@ -35,14 +26,14 @@ def setup_awsy_argument_parser():
return parser
from awsy import ITERATIONS, PER_TAB_PAUSE, SETTLE_WAIT_TIME, MAX_TABS
from awsy import ITERATIONS, MAX_TABS, PER_TAB_PAUSE, SETTLE_WAIT_TIME
def run_awsy(command_context, tests, binary=None, **kwargs):
import json
from mozlog.structured import commandline
from marionette_harness.runtests import MarionetteTestRunner, MarionetteHarness
from marionette_harness.runtests import MarionetteHarness, MarionetteTestRunner
from mozlog.structured import commandline
parser = setup_awsy_argument_parser()

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

@ -4,7 +4,7 @@
from __future__ import absolute_import
from setuptools import setup, find_packages
from setuptools import find_packages, setup
PACKAGE_NAME = "awsy"
PACKAGE_VERSION = "0.0.1"

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

@ -4,13 +4,14 @@
"""Helper to create tarballs.
"""
from __future__ import absolute_import
import tarfile
import os
import glob
import copy
from condprof.util import TASK_CLUSTER
import copy
import glob
import os
import tarfile
from condprof import progress
from condprof.util import TASK_CLUSTER
def _tarinfo2mem(tar, tarinfo):

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

@ -8,10 +8,11 @@
Maintains a unique file that lists all artifacts operations.
"""
from __future__ import absolute_import
import os
import json
from datetime import datetime
import os
import sys
from datetime import datetime
# XXX we should do one per platform and use platform-changelog.json as a name

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

@ -7,10 +7,10 @@ This module tries to make sure we have all dependencies installed on
all our environments.
"""
from __future__ import absolute_import
import sys
import os
import subprocess
import sys
PY3 = sys.version_info.major == 3
TOPDIR = os.path.join(os.path.dirname(__file__), "..")

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

@ -5,26 +5,25 @@
# This module needs to stay Python 2 and 3 compatible
#
from __future__ import absolute_import
import os
import tarfile
import functools
import tempfile
import shutil
import time
from mozprofile.prefs import Preferences
import functools
import os
import shutil
import tarfile
import tempfile
import time
from condprof import check_install # NOQA
from condprof import progress
from condprof.util import (
download_file,
TASK_CLUSTER,
logger,
check_exists,
ArchiveNotFound,
)
from condprof.changelog import Changelog
from condprof.util import (
TASK_CLUSTER,
ArchiveNotFound,
check_exists,
download_file,
logger,
)
from mozprofile.prefs import Preferences
TC_SERVICE = "https://firefox-ci-tc.services.mozilla.com"
ROOT_URL = TC_SERVICE + "/api/index"

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

@ -3,8 +3,9 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import os
import json
import os
HERE = os.path.dirname(__file__)

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

@ -4,6 +4,7 @@
""" Helpers to build scenarii
"""
from __future__ import absolute_import
from condprof.util import logger
_SUPPORTED_MOBILE_BROWSERS = "fenix", "gecko", "firefox"

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

@ -4,8 +4,9 @@
""" Script that launches profiles creation.
"""
from __future__ import absolute_import
import os
import argparse
import os
import sys
# easier than setting PYTHONPATH in various platforms

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

@ -4,14 +4,14 @@
""" Manages a metadata file.
"""
from __future__ import absolute_import
import os
import datetime
from collections.abc import MutableMapping
import json
import os
from collections.abc import MutableMapping
from condprof.util import logger
METADATA_NAME = "condprofile.json"

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

@ -6,6 +6,7 @@
# patch for https://bugzilla.mozilla.org/show_bug.cgi?id=1655869
# see https://github.com/HDE/arsenic/issues/85
from __future__ import absolute_import
from arsenic.connection import *

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

@ -9,7 +9,6 @@ from condprof.scenarii.settled import settled
from condprof.scenarii.settled2 import settled2
from condprof.scenarii.settled_youtube import settled_youtube
scenarii = {
"full": full,
"settled": settled,

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

@ -3,15 +3,14 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import random
import os
import asyncio
from arsenic.errors import UnknownError, UnknownArsenicError
import os
import random
from condprof.util import logger, get_credentials
from arsenic.errors import UnknownArsenicError, UnknownError
from condprof.helpers import TabSwitcher, execute_async_script, is_mobile
from condprof.util import get_credentials, logger
BOOKMARK_FREQUENCY = 5
MAX_URLS = 150

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

@ -3,6 +3,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import asyncio

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

@ -3,6 +3,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import asyncio

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

@ -1,10 +1,10 @@
#!/usr/bin/env python3
from __future__ import absolute_import
from uuid import uuid4
import argparse
import json
from http.server import BaseHTTPRequestHandler, HTTPServer
import argparse
from uuid import uuid4
_SESSIONS = {}

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

@ -1,18 +1,17 @@
from __future__ import absolute_import
import unittest
import os
import tempfile
import shutil
import responses
import re
import json
import os
import re
import shutil
import tarfile
import tempfile
import unittest
from mozprofile.prefs import Preferences
from condprof.client import get_profile, TC_SERVICE, ROOT_URL
import responses
from condprof.client import ROOT_URL, TC_SERVICE, get_profile
from condprof.util import _DEFAULT_SERVER
from mozprofile.prefs import Preferences
PROFILE = re.compile(ROOT_URL + "/.*/.*tgz")
PROFILE_FOR_TESTS = os.path.join(os.path.dirname(__file__), "profile")

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

@ -1,18 +1,17 @@
from __future__ import absolute_import
import os
import unittest
import tempfile
import shutil
import re
import asyncio
import os
import re
import shutil
import tarfile
import tempfile
import unittest
import responses
from condprof.main import main
from condprof.client import ROOT_URL, TC_SERVICE
from condprof import client
from condprof.client import ROOT_URL, TC_SERVICE
from condprof.main import main
client.RETRIES = 1
client.RETRY_PAUSE = 0

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

@ -6,24 +6,21 @@
#
from __future__ import absolute_import, division, print_function
import platform
import time
import os
import shutil
import contextlib
import yaml
from subprocess import Popen, PIPE
import os
import platform
import shutil
import sys
import tempfile
import requests
from requests.exceptions import ConnectionError
from requests.packages.urllib3.util.retry import Retry
import time
from subprocess import PIPE, Popen
import mozlog
import requests
import yaml
from condprof import progress
from requests.exceptions import ConnectionError
from requests.packages.urllib3.util.retry import Retry
TASK_CLUSTER = "TASK_ID" in os.environ.keys()
DOWNLOAD_TIMEOUT = 30

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

@ -2,12 +2,13 @@
# 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
import logging
import sys
import os
import sys
import tempfile
from mach.decorators import CommandArgument, Command
from mach.decorators import Command, CommandArgument
from mozbuild.base import BinaryNotFoundException
requirements = os.path.join(os.path.dirname(__file__), "requirements", "base.txt")

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

@ -3,8 +3,8 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from setuptools import setup, find_packages
from setuptools import find_packages, setup
entry_points = """
[console_scripts]

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

@ -3,6 +3,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from marionette_harness import BaseMarionetteArguments

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

@ -5,10 +5,10 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from marionette_harness.runtests import cli as mn_cli
from firefox_ui_harness.arguments import FirefoxUIArguments
from firefox_ui_harness.runners import FirefoxUITestRunner
from marionette_harness.runtests import cli as mn_cli
def cli(args=None):

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

@ -3,6 +3,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import os
from marionette_harness import BaseMarionetteTestRunner, MarionetteTestCase

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

@ -4,9 +4,11 @@
from __future__ import absolute_import
import os
import re
from setuptools import setup, find_packages
from setuptools import find_packages, setup
THIS_DIR = os.path.dirname(os.path.realpath(__name__))

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

@ -4,19 +4,14 @@
from __future__ import absolute_import, unicode_literals
import six
import logging
import os
import sys
from mozbuild.base import (
MachCommandConditions as conditions,
BinaryNotFoundException,
)
from mach.decorators import (
Command,
)
import six
from mach.decorators import Command
from mozbuild.base import BinaryNotFoundException
from mozbuild.base import MachCommandConditions as conditions
def setup_argument_parser_functional():
@ -29,9 +24,10 @@ def setup_argument_parser_functional():
def run_firefox_ui_test(topsrcdir=None, **kwargs):
from mozlog.structured import commandline
from argparse import Namespace
import firefox_ui_harness
from mozlog.structured import commandline
parser = setup_argument_parser_functional()

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

@ -5,7 +5,6 @@
from __future__ import absolute_import
import os
from functools import reduce
from marionette_driver import Wait

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

@ -6,7 +6,7 @@ from __future__ import absolute_import
import time
from marionette_driver import By, expected, Wait
from marionette_driver import By, Wait, expected
from marionette_harness import MarionetteTestCase, WindowManagerMixin

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

@ -6,7 +6,7 @@ from __future__ import absolute_import
import time
from marionette_driver import By, expected, Wait
from marionette_driver import By, Wait, expected
from marionette_harness import MarionetteTestCase, WindowManagerMixin

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

@ -4,15 +4,10 @@
from __future__ import absolute_import, print_function, unicode_literals
import os
import logging
import os
from mach.decorators import (
Command,
CommandArgument,
CommandArgumentGroup,
)
from mach.decorators import Command, CommandArgument, CommandArgumentGroup
from mozbuild.base import BinaryNotFoundException

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

@ -1,10 +1,11 @@
#!/usr/bin/env python3
from __future__ import absolute_import, division, print_function
import sys
import subprocess
import json
import statistics
import subprocess
import sys
proc = subprocess.Popen(["./mach", "gtest", sys.argv[1]], stdout=subprocess.PIPE)
for line in proc.stdout:

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

@ -8,9 +8,7 @@ import os
import sys
from argparse import Namespace
from mach.decorators import (
Command,
)
from mach.decorators import Command
here = os.path.abspath(os.path.dirname(__file__))
parser = None

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

@ -12,7 +12,6 @@ import glob
import os
import posixpath
import shutil
import six
import sys
import tempfile
import time
@ -22,6 +21,7 @@ import mozcrash
import mozdevice
import mozinfo
import mozlog
import six
LOGGER_NAME = "gtest"
log = mozlog.unstructured.getLogger(LOGGER_NAME)

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

@ -7,20 +7,12 @@ from __future__ import absolute_import, print_function, unicode_literals
import argparse
import logging
import os
import sys
import subprocess
import sys
from mach.decorators import (
CommandArgument,
Command,
SettingsProvider,
SubCommand,
)
from mozbuild.base import (
BuildEnvironmentNotFoundException,
MachCommandConditions as conditions,
)
from mach.decorators import Command, CommandArgument, SettingsProvider, SubCommand
from mozbuild.base import BuildEnvironmentNotFoundException
from mozbuild.base import MachCommandConditions as conditions
UNKNOWN_TEST = """
I was unable to find tests from the given argument(s).
@ -173,8 +165,9 @@ def addtest(
editor=MISSING_ARG,
**kwargs,
):
import addtest
import io
import addtest
from moztest.resolve import TEST_SUITES
if not suite and not test:
@ -387,7 +380,7 @@ def test(command_context, what, extra_args, **log_args):
"""
from mozlog.commandline import setup_logging
from mozlog.handlers import StreamHandler
from moztest.resolve import get_suite_definition, TestResolver, TEST_SUITES
from moztest.resolve import TEST_SUITES, TestResolver, get_suite_definition
resolver = command_context._spawn(TestResolver)
run_suites, run_tests = resolver.resolve_metadata(what)
@ -508,8 +501,8 @@ def run_cppunit_test(command_context, **params):
if conditions.is_android(command_context):
from mozrunner.devices.android_device import (
verify_android_device,
InstallIntent,
verify_android_device,
)
verify_android_device(command_context, install=InstallIntent.NO)

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

@ -3,6 +3,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import os
from . import errors

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

@ -5,7 +5,6 @@
from __future__ import absolute_import, print_function
import socket
from functools import wraps

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

@ -12,20 +12,17 @@ import socket
import sys
import time
import traceback
from contextlib import contextmanager
import six
from six import reraise
from . import errors
from . import transport
from . import errors, transport
from .decorators import do_process_check
from .geckoinstance import GeckoInstance
from .keys import Keys
from .timeout import Timeouts
FRAME_KEY = "frame-075b-4da1-b6ba-e579c2d3230a"
WEB_ELEMENT_KEY = "element-6066-11e4-a52e-4f735466cecf"
WEB_SHADOW_ROOT_KEY = "shadow-6066-11e4-a52e-4f735466cecf"

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

@ -6,7 +6,6 @@ from __future__ import absolute_import
from . import errors
DEFAULT_SCRIPT_TIMEOUT = 30
DEFAULT_PAGE_LOAD_TIMEOUT = 300
DEFAULT_IMPLICIT_WAIT_TIMEOUT = 0

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

@ -10,7 +10,6 @@ import time
from . import errors
DEFAULT_TIMEOUT = 5
DEFAULT_INTERVAL = 0.1

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

@ -6,7 +6,8 @@ from __future__ import absolute_import
import os
import re
from setuptools import setup, find_packages
from setuptools import find_packages, setup
THIS_DIR = os.path.dirname(os.path.realpath(__name__))

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

@ -8,14 +8,14 @@ __version__ = "5.0.2"
from .marionette_test import (
CommonTestCase,
expectedFailure,
MarionetteTestCase,
SkipTest,
expectedFailure,
parameterized,
run_if_manage_instance,
skip,
skip_if_chrome,
skip_if_desktop,
SkipTest,
skip_unless_browser_pref,
skip_unless_protocol,
unexpectedSuccess,

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

@ -6,10 +6,7 @@ from __future__ import absolute_import
__version__ = "3.1.0"
from unittest.case import (
skip,
SkipTest,
)
from unittest.case import SkipTest, skip
from .decorators import (
parameterized,
@ -20,11 +17,10 @@ from .decorators import (
skip_unless_protocol,
with_parameters,
)
from .testcases import (
CommonTestCase,
expectedFailure,
MarionetteTestCase,
MetaParameterized,
expectedFailure,
unexpectedSuccess,
)

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

@ -6,7 +6,6 @@ from __future__ import absolute_import
import functools
import types
from unittest.case import SkipTest

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

@ -12,11 +12,9 @@ import time
import unittest
import warnings
import weakref
from unittest.case import SkipTest
import six
from marionette_driver.errors import TimeoutException, UnresponsiveInstanceException
from mozlog import get_default_logger

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

@ -15,5 +15,4 @@ from .base import (
TestResult,
TestResultCollection,
)
from .mixins import WindowManagerMixin

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

@ -13,29 +13,24 @@ import sys
import time
import traceback
import unittest
from argparse import ArgumentParser
from collections import defaultdict
from copy import deepcopy
import six
import mozinfo
import moznetwork
import mozprofile
import mozversion
import six
from manifestparser import TestManifest
from manifestparser.filters import tags
from marionette_driver.marionette import Marionette
from moztest.adapters.unit import StructuredTestResult, StructuredTestRunner
from moztest.results import TestResult, TestResultCollection, relevant_line
from six import reraise, MAXSIZE
from six import MAXSIZE, reraise
from . import serve
here = os.path.abspath(os.path.dirname(__file__))

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

@ -17,10 +17,10 @@ import select
import sys
import time
from wptserve import handlers, request, routes as default_routes, server
from six.moves.urllib import parse as urlparse
from wptserve import handlers, request
from wptserve import routes as default_routes
from wptserve import server
root = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
default_doc_root = os.path.join(root, "www")

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

@ -15,14 +15,12 @@ import argparse
import multiprocessing
import os
import sys
from collections import defaultdict
from six import iteritems
from . import httpd
__all__ = [
"default_doc_root",
"iter_proc",

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

@ -7,14 +7,12 @@ from __future__ import absolute_import
import sys
import mozlog
from marionette_driver import __version__ as driver_version
from marionette_harness import (
__version__,
BaseMarionetteTestRunner,
BaseMarionetteArguments,
BaseMarionetteTestRunner,
MarionetteTestCase,
__version__,
)

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

@ -9,7 +9,6 @@ import re
from setuptools import find_packages, setup
THIS_DIR = os.path.dirname(os.path.realpath(__name__))

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

@ -7,18 +7,15 @@ from __future__ import absolute_import
import argparse
import os
import sys
from functools import partial
from mach.decorators import (
Command,
)
from mach.decorators import Command
parser = None
def run_marionette(context, **kwargs):
from marionette.runtests import MarionetteTestRunner, MarionetteHarness
from marionette.runtests import MarionetteHarness, MarionetteTestRunner
from mozlog.structured import commandline
args = argparse.Namespace(**kwargs)

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

@ -1,6 +1,7 @@
from __future__ import absolute_import, division, print_function
import math
import mozinfo

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

@ -4,24 +4,18 @@
from __future__ import absolute_import, print_function, unicode_literals
from argparse import Namespace
from collections import defaultdict
import functools
import logging
import os
import six
import sys
import warnings
from argparse import Namespace
from collections import defaultdict
from mozbuild.base import (
MachCommandConditions as conditions,
MozbuildObject,
)
from mach.decorators import (
CommandArgument,
Command,
)
import six
from mach.decorators import Command, CommandArgument
from mozbuild.base import MachCommandConditions as conditions
from mozbuild.base import MozbuildObject
here = os.path.abspath(os.path.dirname(__file__))
@ -230,8 +224,8 @@ def setup_argument_parser():
# be done in this admittedly awkward place because
# MochitestArgumentParser initialization fails if no device is found.
from mozrunner.devices.android_device import (
verify_android_device,
InstallIntent,
verify_android_device,
)
# verify device and xre
@ -265,10 +259,9 @@ def setup_junit_argument_parser():
imp.load_module("mochitest", fh, path, (".py", "r", imp.PY_SOURCE))
import runjunit
from mozrunner.devices.android_device import (
verify_android_device,
InstallIntent,
verify_android_device,
)
verify_android_device(
@ -463,9 +456,9 @@ def run_mochitest_general(
if buildapp == "android":
from mozrunner.devices.android_device import (
InstallIntent,
get_adb_path,
verify_android_device,
InstallIntent,
)
app = kwargs.get("app")
@ -542,9 +535,9 @@ def run_junit(command_context, no_install, **kwargs):
command_context._ensure_state_subdir_exists(".")
from mozrunner.devices.android_device import (
InstallIntent,
get_adb_path,
verify_android_device,
InstallIntent,
)
# verify installation

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

@ -3,16 +3,15 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import, unicode_literals
import six
import json
import os
import sys
from argparse import Namespace
from functools import partial
from mach.decorators import (
Command,
)
import six
from mach.decorators import Command
here = os.path.abspath(os.path.dirname(__file__))
parser = None

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

@ -3,31 +3,29 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import, print_function
import six
from abc import ABCMeta, abstractmethod, abstractproperty
from argparse import ArgumentParser, SUPPRESS
from distutils.util import strtobool
from distutils import spawn
from itertools import chain
from six.moves.urllib.parse import urlparse
import json
import os
import tempfile
import sys
import tempfile
from abc import ABCMeta, abstractmethod, abstractproperty
from argparse import SUPPRESS, ArgumentParser
from distutils import spawn
from distutils.util import strtobool
from itertools import chain
from mozprofile import DEFAULT_PORTS
import mozinfo
import mozlog
import moznetwork
import six
from mozprofile import DEFAULT_PORTS
from six.moves.urllib.parse import urlparse
here = os.path.abspath(os.path.dirname(__file__))
try:
from mozbuild.base import (
MozbuildObject,
MachCommandConditions as conditions,
)
from mozbuild.base import MachCommandConditions as conditions
from mozbuild.base import MozbuildObject
build_obj = MozbuildObject.from_environment(cwd=here)
except ImportError:

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

@ -10,6 +10,7 @@ SIGINT.
"""
from __future__ import absolute_import
import signal
import sys

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

@ -9,7 +9,6 @@ import os
import posixpath
import re
import shutil
import six
import sys
import tempfile
import traceback
@ -18,8 +17,9 @@ import mozcrash
import mozinfo
import mozlog
import moznetwork
import six
from mozdevice import ADBDeviceFactory, ADBError, ADBTimeoutError
from mozprofile import Profile, DEFAULT_PORTS
from mozprofile import DEFAULT_PORTS, Profile
from mozprofile.cli import parse_preferences
from mozprofile.permissions import ServerLocations
from runtests import MochitestDesktop, update_mozinfo
@ -27,11 +27,9 @@ from runtests import MochitestDesktop, update_mozinfo
here = os.path.abspath(os.path.dirname(__file__))
try:
from mozbuild.base import (
MozbuildObject,
MachCommandConditions as conditions,
)
from mach.util import UserError
from mozbuild.base import MachCommandConditions as conditions
from mozbuild.base import MozbuildObject
build_obj = MozbuildObject.from_environment(cwd=here)
except ImportError:

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

@ -3,6 +3,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import datetime
import os
import posixpath
@ -14,12 +15,12 @@ import uuid
sys.path.insert(0, os.path.abspath(os.path.realpath(os.path.dirname(__file__))))
from runtests import MochitestDesktop, MessageLogger
from mochitest_options import MochitestArgumentParser, build_obj
from mozdevice import ADBDeviceFactory, ADBTimeoutError, RemoteProcessMonitor
from mozscreenshot import dump_screen, dump_device_screen
import mozcrash
import mozinfo
from mochitest_options import MochitestArgumentParser, build_obj
from mozdevice import ADBDeviceFactory, ADBTimeoutError, RemoteProcessMonitor
from mozscreenshot import dump_device_screen, dump_screen
from runtests import MessageLogger, MochitestDesktop
SCRIPT_DIR = os.path.abspath(os.path.realpath(os.path.dirname(__file__)))

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

@ -3,14 +3,14 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import, print_function, unicode_literals
import six
import json
import os
from argparse import Namespace
import pytest
import mozinfo
import pytest
import six
from manifestparser import TestManifest, expression
from moztest.selftest.fixtures import binary_fixture, setup_test_harness # noqa

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

@ -8,14 +8,13 @@ import json
import os
from argparse import Namespace
from mozbuild.base import MozbuildObject
from mozprofile.prefs import Preferences
from mozprofile import Profile
from six import string_types
import mozunit
import pytest
from conftest import setup_args
from mozbuild.base import MozbuildObject
from mozprofile import Profile
from mozprofile.prefs import Preferences
from six import string_types
here = os.path.abspath(os.path.dirname(__file__))

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

@ -4,18 +4,17 @@
from __future__ import absolute_import, print_function, unicode_literals
import six
import os
import unittest.mock as mock
from argparse import Namespace
from collections import defaultdict
from textwrap import dedent
from manifestparser import TestManifest
import mozunit
import pytest
import unittest.mock as mock
import six
from conftest import setup_args
from manifestparser import TestManifest
# Directly running runTests() is likely not working nor a good idea

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

@ -4,17 +4,16 @@
from __future__ import absolute_import, print_function, unicode_literals
import six
import os
from argparse import Namespace
from collections import defaultdict
from textwrap import dedent
from manifestparser import TestManifest
import mozunit
import pytest
import six
from conftest import setup_args
from manifestparser import TestManifest
@pytest.fixture

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

@ -3,13 +3,13 @@
from __future__ import absolute_import, print_function
import six
import json
import time
import types
import mozunit
import pytest
import six
from conftest import setup_args
from mozlog.formatters import JSONFormatter
from mozlog.handlers.base import StreamHandler

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

@ -9,13 +9,11 @@ from functools import partial
import mozunit
import pytest
from manifestparser import TestManifest
from moztest.selftest.output import get_mozharness_status, filter_action
from conftest import setup_args
from mozharness.base.log import INFO, WARNING, ERROR
from mozharness.mozilla.automation import TBPL_SUCCESS, TBPL_WARNING, TBPL_FAILURE
from manifestparser import TestManifest
from mozharness.base.log import ERROR, INFO, WARNING
from mozharness.mozilla.automation import TBPL_FAILURE, TBPL_SUCCESS, TBPL_WARNING
from moztest.selftest.output import filter_action, get_mozharness_status
here = os.path.abspath(os.path.dirname(__file__))
get_mozharness_status = partial(get_mozharness_status, "mochitest")

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

@ -4,12 +4,12 @@
from __future__ import absolute_import
import six
import argparse
import sys
import traceback
import types
import six
from mozlog import commandline, get_default_logger

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

@ -13,8 +13,8 @@
from __future__ import absolute_import
import sys
import os
import sys
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the

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

@ -5,6 +5,6 @@
from __future__ import absolute_import
from .manifestparser import *
from .expression import *
from .ini import *
from .manifestparser import *

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

@ -8,14 +8,11 @@ Mozilla universal manifest parser
"""
from __future__ import absolute_import, print_function
from optparse import OptionParser
import os
import sys
from optparse import OptionParser
from .manifestparser import (
convert,
ManifestParser,
)
from .manifestparser import ManifestParser, convert
class ParserError(Exception):

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

@ -18,10 +18,7 @@ from collections.abc import MutableSequence
import six
from six import string_types
from .expression import (
parse,
ParseError,
)
from .expression import ParseError, parse
from .util import normsep
logger = None

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

@ -13,15 +13,12 @@ import shutil
import sys
import types
from six import string_types, StringIO
from six import StringIO, string_types
from .filters import DEFAULT_FILTERS, enabled
from .filters import exists as _exists
from .filters import filterlist
from .ini import read_ini
from .filters import (
DEFAULT_FILTERS,
enabled,
exists as _exists,
filterlist,
)
__all__ = ["ManifestParser", "TestManifest", "convert"]

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

@ -8,15 +8,10 @@ from collections import defaultdict
from itertools import chain
from unittest import TestCase
from six.moves import range
from six import iteritems
import mozunit
from manifestparser.filters import (
chunk_by_dir,
chunk_by_runtime,
chunk_by_slice,
)
from manifestparser.filters import chunk_by_dir, chunk_by_runtime, chunk_by_slice
from six import iteritems
from six.moves import range
here = os.path.dirname(os.path.abspath(__file__))

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

@ -12,9 +12,7 @@ import tempfile
import unittest
import mozunit
from manifestparser import convert
from manifestparser import ManifestParser
from manifestparser import ManifestParser, convert
here = os.path.dirname(os.path.abspath(__file__))

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

@ -12,8 +12,7 @@ import tempfile
import unittest
import mozunit
from manifestparser import convert, ManifestParser
from manifestparser import ManifestParser, convert
class TestSymlinkConversion(unittest.TestCase):

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

@ -10,9 +10,7 @@ import os
import unittest
import mozunit
from manifestparser import ManifestParser
from manifestparser import combine_fields
from manifestparser import ManifestParser, combine_fields
here = os.path.dirname(os.path.abspath(__file__))

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

@ -5,7 +5,6 @@ from __future__ import absolute_import
import unittest
import mozunit
from manifestparser import parse

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

@ -9,17 +9,16 @@ from pprint import pprint
import mozpack.path as mozpath
import mozunit
import pytest
from manifestparser.filters import (
enabled,
fail_if,
failures,
filterlist,
pathprefix,
run_if,
skip_if,
subsuite,
tags,
failures,
)
here = os.path.dirname(os.path.abspath(__file__))

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

@ -10,11 +10,10 @@ import os
import shutil
import tempfile
import unittest
from six import StringIO
import mozunit
from manifestparser import ManifestParser
from six import StringIO
here = os.path.dirname(os.path.abspath(__file__))

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

@ -16,9 +16,8 @@ from textwrap import dedent
import mozunit
import pytest
from six import StringIO
from manifestparser import read_ini
from six import StringIO
@pytest.fixture(scope="module")

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

@ -8,8 +8,7 @@ import tempfile
import unittest
import mozunit
from manifestparser import TestManifest, ParseError
from manifestparser import ParseError, TestManifest
from manifestparser.filters import subsuite
here = os.path.dirname(os.path.abspath(__file__))

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

@ -10,10 +10,9 @@ from textwrap import dedent
import mozunit
import pytest
from six import StringIO
from manifestparser import read_ini
from manifestparser.util import evaluate_list_from_string
from six import StringIO
@pytest.fixture(scope="module")

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

@ -4,11 +4,10 @@ from __future__ import absolute_import
import uuid
import mozcrash
import pytest
from py._path.common import fspath
import mozcrash
@pytest.fixture(scope="session")
def stackwalk(tmpdir_factory):

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

@ -5,7 +5,6 @@ from __future__ import absolute_import
import mozunit
import pytest
from conftest import fspath

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

@ -6,7 +6,6 @@ import os
import mozunit
import pytest
from conftest import fspath

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

@ -6,7 +6,6 @@ from __future__ import absolute_import
import os
import mozunit
from conftest import fspath

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

@ -4,13 +4,12 @@
from __future__ import absolute_import
import zipfile
from six import BytesIO
from six.moves.urllib.parse import urlunsplit
import mozhttpd
import mozunit
from conftest import fspath
from six import BytesIO
from six.moves.urllib.parse import urlunsplit
def test_symbols_path_not_present(check_for_crashes, minidump_files):

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

@ -8,12 +8,13 @@ from __future__ import absolute_import, print_function
import json
import os
import mozinfo
import sys
from collections import namedtuple
from distutils.spawn import find_executable
from subprocess import check_output
import mozinfo
__all__ = [
"get_debugger_info",
"get_default_debugger_name",

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

@ -12,7 +12,6 @@ from mozdebug.mozdebug import (
get_default_debugger_name,
)
here = os.path.abspath(os.path.dirname(__file__))
@ -33,9 +32,10 @@ def set_debuggers(monkeypatch):
@pytest.mark.parametrize("os_name", ["android", "linux", "mac", "win", "unknown"])
def test_default_debugger_name(os_name, set_debuggers, monkeypatch):
import mozinfo
import sys
import mozinfo
def update_os_name(*args, **kwargs):
mozinfo.info["os"] = os_name

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

@ -156,8 +156,16 @@ any existing content.
from __future__ import absolute_import
from .adb import ADBError, ADBProcessError, ADBTimeoutError
from .adb import ADBProcess, ADBCommand, ADBHost, ADBDevice, ADBDeviceFactory
from .adb import (
ADBCommand,
ADBDevice,
ADBDeviceFactory,
ADBError,
ADBHost,
ADBProcess,
ADBProcessError,
ADBTimeoutError,
)
from .adb_android import ADBAndroid
from .remote_process_monitor import RemoteProcessMonitor

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

@ -3,10 +3,12 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import, print_function
import re
import six
import time
import six
from .adb import ADBTimeoutError

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

@ -2,10 +2,10 @@ from __future__ import absolute_import, print_function
import sys
from random import randint, seed
from unittest.mock import patch
import mozdevice
import pytest
from unittest.mock import patch
from six import StringIO
# set up required module-level variables/objects

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

@ -3,7 +3,6 @@
from __future__ import absolute_import
import logging
from unittest.mock import patch
import mozunit

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

@ -2,9 +2,8 @@
from __future__ import absolute_import
import pytest
import mozunit
import pytest
from mozdevice import ADBError

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

@ -4,7 +4,6 @@ from __future__ import absolute_import
import mozunit
import pytest
from conftest import random_tcp_port

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

@ -4,7 +4,6 @@ import os
import shutil
import tempfile
# stub file paths
files = [
("foo.txt",),

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше