diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index 7a9f8139d..d7c7c81e4 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -44,3 +44,11 @@ jobs: user: __token__ password: ${{ secrets.PYPI_PUBLISH_PASSWORD }} skip_existing: true + + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: pip install -U autoflake isort + - run: autoflake . + - run: isort --check --diff --color . diff --git a/examples/all_the_things.py b/examples/all_the_things.py index 199bb5a9a..3a7184546 100644 --- a/examples/all_the_things.py +++ b/examples/all_the_things.py @@ -20,9 +20,9 @@ import os.path import time -import openhtf as htf -from openhtf import util from examples import example_plugs +from openhtf import util +import openhtf as htf from openhtf.output import callbacks from openhtf.output.callbacks import console_summary from openhtf.output.callbacks import json_factory diff --git a/examples/checkpoints.py b/examples/checkpoints.py index 3a6938a07..8d5ce5ddc 100644 --- a/examples/checkpoints.py +++ b/examples/checkpoints.py @@ -15,8 +15,8 @@ import time -import openhtf as htf from examples import measurements as measurements_example +import openhtf as htf from openhtf.output.callbacks import console_summary from openhtf.output.callbacks import json_factory from openhtf.util import checkpoints diff --git a/examples/hello_world.py b/examples/hello_world.py index cff69afba..a6b811831 100644 --- a/examples/hello_world.py +++ b/examples/hello_world.py @@ -30,10 +30,8 @@ # from it throughout our test scripts. See __all__ at the top of # openhtf/__init__.py for details on what's in top-of-module namespace. import openhtf as htf - # Import this output mechanism as it's the specific one we want to use. from openhtf.output.callbacks import json_factory - from openhtf.plugs import user_input diff --git a/examples/measurements.py b/examples/measurements.py index 660fbec7e..4e44ce116 100644 --- a/examples/measurements.py +++ b/examples/measurements.py @@ -49,10 +49,8 @@ import random import openhtf as htf - # Import this output mechanism as it's the specific one we want to use. from openhtf.output.callbacks import json_factory - # You won't normally need to import this, see validators.py example for # more details. It's used for the inline measurement declaration example # below, but normally you'll only import it when you want to define custom diff --git a/openhtf/__init__.py b/openhtf/__init__.py index 8fba946c2..a0a33d1c5 100644 --- a/openhtf/__init__.py +++ b/openhtf/__init__.py @@ -14,7 +14,8 @@ """The main OpenHTF entry point.""" import signal -import typing + +import pkg_resources from openhtf import plugs from openhtf.core import phase_executor @@ -27,7 +28,6 @@ from openhtf.core.diagnoses_lib import DiagResultEnum from openhtf.core.diagnoses_lib import PhaseDiagnoser from openhtf.core.diagnoses_lib import TestDiagnoser - from openhtf.core.measurements import Dimension from openhtf.core.measurements import Measurement from openhtf.core.monitors import monitors @@ -57,7 +57,6 @@ from openhtf.util import functions from openhtf.util import logs from openhtf.util import units -import pkg_resources conf = configuration.CONF diff --git a/openhtf/core/diagnoses_lib.py b/openhtf/core/diagnoses_lib.py index e8eeed51a..1abb9644e 100644 --- a/openhtf/core/diagnoses_lib.py +++ b/openhtf/core/diagnoses_lib.py @@ -125,9 +125,11 @@ def main(): from collections.abc import Iterable as CollectionsIterable import enum import logging -from typing import Any, Callable, Dict, Iterable, List, Optional, Sequence, Text, Type, TYPE_CHECKING, Union +from typing import (Any, Callable, Dict, Iterable, List, Optional, Sequence, + Text, Type, TYPE_CHECKING, Union) import attr + from openhtf.core import test_record from openhtf.util import data @@ -324,7 +326,6 @@ def possible_results(self) -> List[Text]: def _check_definition(self) -> None: """Internal function to verify that the diagnoser is completely defined.""" - pass class BasePhaseDiagnoser(_BaseDiagnoser, abc.ABC): diff --git a/openhtf/core/measurements.py b/openhtf/core/measurements.py index 1c0ab344e..cf276af9a 100644 --- a/openhtf/core/measurements.py +++ b/openhtf/core/measurements.py @@ -63,7 +63,8 @@ def WidgetTestPhase(test): import functools import logging import typing -from typing import Any, Callable, Dict, Iterator, List, Optional, Text, Tuple, Union +from typing import (Any, Callable, Dict, Iterator, List, Optional, Text, Tuple, + Union) import attr @@ -71,12 +72,14 @@ def WidgetTestPhase(test): from openhtf.util import data from openhtf.util import units as util_units from openhtf.util import validators + if typing.TYPE_CHECKING: from openhtf.core import diagnoses_lib try: # pylint: disable=g-import-not-at-top import pandas # pytype: disable=import-error + # pylint: enable=g-import-not-at-top except ImportError: pandas = None diff --git a/openhtf/core/monitors.py b/openhtf/core/monitors.py index 02cc60d1a..7d0765a23 100644 --- a/openhtf/core/monitors.py +++ b/openhtf/core/monitors.py @@ -48,6 +48,8 @@ def MyPhase(test): import time from typing import Any, Callable, Dict, Optional, Text +import six + import openhtf from openhtf import plugs from openhtf.core import measurements @@ -55,7 +57,6 @@ def MyPhase(test): from openhtf.core import test_state as core_test_state from openhtf.util import threads from openhtf.util import units as uom -import six class _MonitorThread(threads.KillableThread): diff --git a/openhtf/core/phase_branches.py b/openhtf/core/phase_branches.py index 05f6746ec..f04088e0e 100644 --- a/openhtf/core/phase_branches.py +++ b/openhtf/core/phase_branches.py @@ -20,10 +20,11 @@ import abc import enum -from typing import (TYPE_CHECKING, Any, Callable, Dict, Iterator, Optional, - Text, Tuple, Union) +from typing import (Any, Callable, Dict, Iterator, Optional, Text, Tuple, + TYPE_CHECKING, Union) import attr + from openhtf import util from openhtf.core import diagnoses_lib from openhtf.core import phase_collections diff --git a/openhtf/core/phase_collections.py b/openhtf/core/phase_collections.py index 97a3ade36..3fa8f115b 100644 --- a/openhtf/core/phase_collections.py +++ b/openhtf/core/phase_collections.py @@ -23,9 +23,11 @@ import abc import collections from collections.abc import Iterable as CollectionsIterable -from typing import Any, Callable, DefaultDict, Dict, Iterable, Iterator, List, Optional, Text, Tuple, Type, TypeVar, Union +from typing import (Any, Callable, DefaultDict, Dict, Iterable, Iterator, List, + Optional, Text, Tuple, Type, TypeVar, Union) import attr + from openhtf import util from openhtf.core import base_plugs from openhtf.core import phase_descriptor diff --git a/openhtf/core/phase_descriptor.py b/openhtf/core/phase_descriptor.py index be2f72802..39ce8931d 100644 --- a/openhtf/core/phase_descriptor.py +++ b/openhtf/core/phase_descriptor.py @@ -22,7 +22,8 @@ import enum import inspect import pdb -from typing import Any, Callable, Dict, Iterator, List, Optional, Sequence, Set, Text, TYPE_CHECKING, Type, Union +from typing import (Any, Callable, Dict, Iterator, List, Optional, Sequence, + Set, Text, Type, TYPE_CHECKING, Union) import attr import inflection diff --git a/openhtf/core/phase_executor.py b/openhtf/core/phase_executor.py index ba04e0eb5..8b270cadd 100644 --- a/openhtf/core/phase_executor.py +++ b/openhtf/core/phase_executor.py @@ -39,6 +39,7 @@ from typing import Any, Dict, Optional, Text, Tuple, Type, TYPE_CHECKING, Union import attr + from openhtf import util from openhtf.core import phase_branches from openhtf.core import phase_descriptor diff --git a/openhtf/core/phase_nodes.py b/openhtf/core/phase_nodes.py index 01d023cae..441526f59 100644 --- a/openhtf/core/phase_nodes.py +++ b/openhtf/core/phase_nodes.py @@ -15,13 +15,15 @@ """Contains the abstract interfaces for phase nodes.""" import abc -from typing import Any, Callable, Dict, Optional, Text, Type, TypeVar, TYPE_CHECKING +from typing import (Any, Callable, Dict, Optional, Text, Type, TYPE_CHECKING, + TypeVar) from openhtf.core import base_plugs from openhtf.util import data if TYPE_CHECKING: - from openhtf.core import phase_descriptor # pylint: disable=g-import-not-at-top + from openhtf.core import \ + phase_descriptor # pylint: disable=g-import-not-at-top WithModifierT = TypeVar('WithModifierT', bound='PhaseNode') ApplyAllNodesT = TypeVar('ApplyAllNodesT', bound='PhaseNode') diff --git a/openhtf/core/test_descriptor.py b/openhtf/core/test_descriptor.py index fdf16c65c..9ed9c1d14 100644 --- a/openhtf/core/test_descriptor.py +++ b/openhtf/core/test_descriptor.py @@ -45,7 +45,6 @@ from openhtf.core import test_executor from openhtf.core import test_record as htf_test_record from openhtf.core import test_state - from openhtf.util import configuration from openhtf.util import console_output from openhtf.util import logs diff --git a/openhtf/core/test_executor.py b/openhtf/core/test_executor.py index fba61b2c4..b64c6fe08 100644 --- a/openhtf/core/test_executor.py +++ b/openhtf/core/test_executor.py @@ -40,7 +40,8 @@ CONF = configuration.CONF if TYPE_CHECKING: - from openhtf.core import test_descriptor # pylint: disable=g-import-not-at-top + from openhtf.core import \ + test_descriptor # pylint: disable=g-import-not-at-top _LOG = logging.getLogger(__name__) diff --git a/openhtf/core/test_record.py b/openhtf/core/test_record.py index bddce0357..b7db1b1fa 100644 --- a/openhtf/core/test_record.py +++ b/openhtf/core/test_record.py @@ -33,9 +33,10 @@ if TYPE_CHECKING: from openhtf.core import diagnoses_lib # pylint: disable=g-import-not-at-top from openhtf.core import measurements as htf_measurements # pylint: disable=g-import-not-at-top - from openhtf.core import phase_descriptor # pylint: disable=g-import-not-at-top - from openhtf.core import phase_executor # pylint: disable=g-import-not-at-top from openhtf.core import phase_branches # pylint: disable=g-import-not-at-top + from openhtf.core import \ + phase_descriptor # pylint: disable=g-import-not-at-top + from openhtf.core import phase_executor # pylint: disable=g-import-not-at-top CONF.declare( 'attachments_directory', diff --git a/openhtf/core/test_state.py b/openhtf/core/test_state.py index 6325c92ca..38c5fd554 100644 --- a/openhtf/core/test_state.py +++ b/openhtf/core/test_state.py @@ -32,9 +32,11 @@ import os import socket import sys -from typing import Any, Dict, Iterator, List, Optional, Set, Text, TYPE_CHECKING, Union +from typing import (Any, Dict, Iterator, List, Optional, Set, Text, + TYPE_CHECKING, Union) import attr +from typing_extensions import Literal import openhtf from openhtf import plugs @@ -48,12 +50,12 @@ from openhtf.util import data from openhtf.util import logs from openhtf.util import units -from typing_extensions import Literal CONF = configuration.CONF if TYPE_CHECKING: - from openhtf.core import test_descriptor # pylint: disable=g-import-not-at-top + from openhtf.core import \ + test_descriptor # pylint: disable=g-import-not-at-top CONF.declare( 'allow_unset_measurements', diff --git a/openhtf/output/servers/dashboard_server.py b/openhtf/output/servers/dashboard_server.py index 21fb22200..318d4ddb8 100644 --- a/openhtf/output/servers/dashboard_server.py +++ b/openhtf/output/servers/dashboard_server.py @@ -12,14 +12,15 @@ import threading import time +import sockjs.tornado +import tornado.web + from openhtf.output.servers import pub_sub from openhtf.output.servers import station_server from openhtf.output.servers import web_gui_server from openhtf.output.web_gui import web_launcher from openhtf.util import data from openhtf.util import multicast -import sockjs.tornado -import tornado.web _LOG = logging.getLogger(__name__) diff --git a/openhtf/output/servers/pub_sub.py b/openhtf/output/servers/pub_sub.py index dc2acfdcd..3cca68281 100644 --- a/openhtf/output/servers/pub_sub.py +++ b/openhtf/output/servers/pub_sub.py @@ -15,9 +15,10 @@ import logging -from openhtf import util as htf_util import sockjs.tornado +from openhtf import util as htf_util + _LOG = logging.getLogger(__name__) @@ -67,8 +68,6 @@ def on_close(self): def on_subscribe(self, info): """Called when new clients subscribe. Subclasses can override.""" - pass def on_unsubscribe(self): """Called when clients unsubscribe. Subclasses can override.""" - pass diff --git a/openhtf/output/servers/station_server.py b/openhtf/output/servers/station_server.py index 188872ce3..a3b3d73eb 100644 --- a/openhtf/output/servers/station_server.py +++ b/openhtf/output/servers/station_server.py @@ -17,6 +17,8 @@ import types from typing import Optional, Union +import sockjs.tornado + import openhtf from openhtf.output.servers import pub_sub from openhtf.output.servers import web_gui_server @@ -25,7 +27,6 @@ from openhtf.util import functions from openhtf.util import multicast from openhtf.util import timeouts -import sockjs.tornado CONF = configuration.CONF diff --git a/openhtf/plugs/__init__.py b/openhtf/plugs/__init__.py index f3dfbc0be..393ec3e90 100644 --- a/openhtf/plugs/__init__.py +++ b/openhtf/plugs/__init__.py @@ -21,7 +21,8 @@ """ import logging -from typing import Any, Callable, Dict, Iterable, List, Optional, Set, Text, Tuple, Type, TypeVar, Union +from typing import (Any, Callable, Dict, Iterable, List, Optional, Set, Text, + Tuple, Type, TypeVar, Union) import attr diff --git a/openhtf/plugs/cambrionix/__init__.py b/openhtf/plugs/cambrionix/__init__.py index 4049117c2..fa982f43c 100644 --- a/openhtf/plugs/cambrionix/__init__.py +++ b/openhtf/plugs/cambrionix/__init__.py @@ -15,6 +15,7 @@ import subprocess import time + from openhtf.plugs.usb import local_usb diff --git a/openhtf/plugs/generic/serial_collection.py b/openhtf/plugs/generic/serial_collection.py index 754709f2a..08c2adb9b 100644 --- a/openhtf/plugs/generic/serial_collection.py +++ b/openhtf/plugs/generic/serial_collection.py @@ -28,6 +28,7 @@ try: # pylint: disable=g-import-not-at-top import serial # pytype: disable=import-error + # pylint: enable=g-import-not-at-top except ImportError: logging.error( diff --git a/openhtf/plugs/usb/fastboot_protocol.py b/openhtf/plugs/usb/fastboot_protocol.py index 7507acb4a..2db714de2 100644 --- a/openhtf/plugs/usb/fastboot_protocol.py +++ b/openhtf/plugs/usb/fastboot_protocol.py @@ -20,9 +20,10 @@ import os import struct -from . import usb_exceptions from openhtf.util import argv +from . import usb_exceptions + FASTBOOT_DOWNLOAD_CHUNK_SIZE_KB = 1024 ARG_PARSER = argv.module_parser() diff --git a/openhtf/plugs/usb/local_usb.py b/openhtf/plugs/usb/local_usb.py index ee7b895d9..e230a6849 100644 --- a/openhtf/plugs/usb/local_usb.py +++ b/openhtf/plugs/usb/local_usb.py @@ -29,6 +29,7 @@ # pylint: disable=g-import-not-at-top import libusb1 # pytype: disable=import-error import usb1 # pytype: disable=import-error + # pylint: enable=g-import-not-at-top except ImportError: logging.error('Failed to import libusb, did you pip install ' diff --git a/openhtf/plugs/usb/usb_exceptions.py b/openhtf/plugs/usb/usb_exceptions.py index b16c93811..880aa7a4b 100644 --- a/openhtf/plugs/usb/usb_exceptions.py +++ b/openhtf/plugs/usb/usb_exceptions.py @@ -18,6 +18,7 @@ try: # pylint: disable=g-import-not-at-top import libusb1 # pytype: disable=import-error + # pylint: enable=g-import-not-at-top except ImportError: logging.error('Failed to import libusb, did you pip install ' diff --git a/openhtf/plugs/user_input.py b/openhtf/plugs/user_input.py index 37a21e32d..b2bd3b38a 100644 --- a/openhtf/plugs/user_input.py +++ b/openhtf/plugs/user_input.py @@ -28,6 +28,7 @@ import uuid import attr + import openhtf from openhtf import plugs from openhtf.core import base_plugs diff --git a/openhtf/util/__init__.py b/openhtf/util/__init__.py index 4f735e33f..b21626cc7 100644 --- a/openhtf/util/__init__.py +++ b/openhtf/util/__init__.py @@ -18,7 +18,7 @@ import threading import time import typing -from typing import Any, Callable, Dict, Iterator, Optional, Text, Tuple, Type, TypeVar, Union +from typing import Any, Callable, Dict, Iterator, Optional, Text, Tuple, TypeVar import weakref import attr diff --git a/openhtf/util/configuration.py b/openhtf/util/configuration.py index 986eb61b9..395ac3db8 100644 --- a/openhtf/util/configuration.py +++ b/openhtf/util/configuration.py @@ -145,11 +145,12 @@ def do_stuff(): from typing import Any, Optional, Text, Type, TypeVar import attr -from openhtf.util import argv -from openhtf.util import threads from typing_extensions import Protocol import yaml +from openhtf.util import argv +from openhtf.util import threads + T = TypeVar('T') # If provided, --config-file will cause the given file to be load()ed when the diff --git a/openhtf/util/data.py b/openhtf/util/data.py index a1cb29f1a..1987b01d2 100644 --- a/openhtf/util/data.py +++ b/openhtf/util/data.py @@ -21,8 +21,8 @@ import copy import difflib import enum -import itertools import inspect +import itertools import logging import math import numbers diff --git a/openhtf/util/test.py b/openhtf/util/test.py index 4f8825800..e5fd7f996 100644 --- a/openhtf/util/test.py +++ b/openhtf/util/test.py @@ -126,8 +126,8 @@ def test_multiple(self, mock_my_plug): assertMeasurementFail(phase_or_test_rec, measurement) """ -import collections -from collections.abc import Callable as CollectionsCallable, Iterator +from collections.abc import Callable as CollectionsCallable +from collections.abc import Iterator import functools import inspect import logging @@ -138,23 +138,13 @@ def test_multiple(self, mock_my_plug): import tempfile import types import typing -from typing import ( - Any, - Callable, - Dict, - Iterable, - List, - Optional, - Sequence, - Text, - Tuple, - Type, - Union, -) +from typing import (Any, Callable, Dict, Iterable, List, Optional, Sequence, + Text, Tuple, Type, Union) import unittest from unittest import mock import attr + from openhtf import plugs from openhtf import util from openhtf.core import base_plugs diff --git a/openhtf/util/text.py b/openhtf/util/text.py index f41d9391c..ac2b41cb0 100644 --- a/openhtf/util/text.py +++ b/openhtf/util/text.py @@ -36,6 +36,7 @@ from typing import List, Optional import colorama + import openhtf from openhtf.core import measurements from openhtf.core import phase_descriptor diff --git a/openhtf/util/threads.py b/openhtf/util/threads.py index 092f5ea91..260f8d19e 100644 --- a/openhtf/util/threads.py +++ b/openhtf/util/threads.py @@ -14,7 +14,6 @@ """Thread library defining a few helpers.""" import _thread -import contextlib import cProfile import ctypes import functools diff --git a/openhtf/util/validators.py b/openhtf/util/validators.py index 76d581216..54168700b 100644 --- a/openhtf/util/validators.py +++ b/openhtf/util/validators.py @@ -58,7 +58,7 @@ def MyPhase(test: htf.TestApi) -> None: import math import numbers import re -from typing import Callable, Dict, Optional, Type, TypeVar, Union +from typing import Callable, Dict, Optional, Union from openhtf import util diff --git a/openhtf/util/xmlrpcutil.py b/openhtf/util/xmlrpcutil.py index 1f6b689c1..8e9751abb 100644 --- a/openhtf/util/xmlrpcutil.py +++ b/openhtf/util/xmlrpcutil.py @@ -16,7 +16,6 @@ from collections.abc import Callable import http.client import socketserver -import sys import threading import xmlrpc.client import xmlrpc.server diff --git a/pylint_plugins/conf_plugin.py b/pylint_plugins/conf_plugin.py index ed4215da9..755dd3ba0 100644 --- a/pylint_plugins/conf_plugin.py +++ b/pylint_plugins/conf_plugin.py @@ -14,7 +14,6 @@ import astroid - from astroid import MANAGER diff --git a/pyproject.toml b/pyproject.toml index 21c15292b..90c4d80d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,13 @@ [build-system] requires = ["setuptools>=40.8.0", "wheel>=0.29.0"] build-backend = "setuptools.build_meta" + +[tool.autoflake] +recursive = true +check_diff = true +exclude = "*_pb2.py" + +[tool.isort] +line_length = 80 +profile = "google" +skip_glob = ["*_pb2.py"] diff --git a/setup.py b/setup.py index d68dc84fa..2a702a430 100644 --- a/setup.py +++ b/setup.py @@ -13,6 +13,10 @@ # limitations under the License. """Setup script for OpenHTF.""" +from distutils.cmd import Command +# pylint: disable=g-importing-member,g-bad-import-order +from distutils.command.build import build +from distutils.command.clean import clean import errno import glob import os @@ -20,10 +24,6 @@ import subprocess import sys -# pylint: disable=g-importing-member,g-bad-import-order -from distutils.command.build import build -from distutils.command.clean import clean -from distutils.cmd import Command from setuptools import find_packages from setuptools import setup from setuptools.command.test import test diff --git a/test/core/exe_test.py b/test/core/exe_test.py index fed23869f..3fbf309e7 100644 --- a/test/core/exe_test.py +++ b/test/core/exe_test.py @@ -35,7 +35,6 @@ from openhtf.core import test_executor from openhtf.core import test_record from openhtf.core import test_state - from openhtf.util import configuration from openhtf.util import logs from openhtf.util import timeouts diff --git a/test/core/measurements_test.py b/test/core/measurements_test.py index e6f7d0b73..c0d785645 100644 --- a/test/core/measurements_test.py +++ b/test/core/measurements_test.py @@ -19,12 +19,11 @@ """ import collections -import unittest from unittest import mock +from examples import all_the_things import openhtf as htf from openhtf.core import measurements -from examples import all_the_things from openhtf.util import test as htf_test # Fields that are considered 'volatile' for record comparison. diff --git a/test/core/phase_collections_test.py b/test/core/phase_collections_test.py index 38fea3612..3960d22ed 100644 --- a/test/core/phase_collections_test.py +++ b/test/core/phase_collections_test.py @@ -3,8 +3,8 @@ import unittest from unittest import mock -import openhtf as htf from openhtf import plugs +import openhtf as htf from openhtf.core import base_plugs from openhtf.core import phase_collections from openhtf.core import phase_descriptor diff --git a/test/core/phase_group_test.py b/test/core/phase_group_test.py index a8572e854..903c89d5d 100644 --- a/test/core/phase_group_test.py +++ b/test/core/phase_group_test.py @@ -4,8 +4,8 @@ import unittest from unittest import mock -import openhtf as htf from openhtf import plugs +import openhtf as htf from openhtf.core import base_plugs from openhtf.core import phase_collections from openhtf.core import test_record diff --git a/test/output/callbacks/callbacks_test.py b/test/output/callbacks/callbacks_test.py index ea81ec29b..be982439e 100644 --- a/test/output/callbacks/callbacks_test.py +++ b/test/output/callbacks/callbacks_test.py @@ -20,12 +20,14 @@ import io import json -import unittest -import openhtf as htf -from openhtf import util from examples import all_the_things -from openhtf.core import phase_branches, phase_descriptor, phase_collections, phase_group +from openhtf import util +import openhtf as htf +from openhtf.core import phase_branches +from openhtf.core import phase_collections +from openhtf.core import phase_descriptor +from openhtf.core import phase_group from openhtf.output.callbacks import console_summary from openhtf.output.callbacks import json_factory from openhtf.output.proto import mfg_event_converter diff --git a/test/output/callbacks/mfg_inspector_test.py b/test/output/callbacks/mfg_inspector_test.py index c382cea8c..06fa1a9ca 100644 --- a/test/output/callbacks/mfg_inspector_test.py +++ b/test/output/callbacks/mfg_inspector_test.py @@ -19,12 +19,11 @@ """ import collections import io -import unittest from unittest import mock -import openhtf as htf -from openhtf import util from examples import all_the_things +from openhtf import util +import openhtf as htf from openhtf.output.callbacks import mfg_inspector from openhtf.output.proto import guzzle_pb2 from openhtf.output.proto import test_runs_converter diff --git a/test/phase_descriptor_test.py b/test/phase_descriptor_test.py index 1fdd92dca..cd4ebbb49 100644 --- a/test/phase_descriptor_test.py +++ b/test/phase_descriptor_test.py @@ -15,8 +15,8 @@ import unittest from absl import logging - import attr + import openhtf from openhtf import plugs from openhtf.core import base_plugs @@ -30,7 +30,6 @@ def plain_func(): """Plain Docstring.""" - pass def normal_test_phase(): diff --git a/test/plugs/plugs_test.py b/test/plugs/plugs_test.py index 6325c7084..eaaedfd63 100644 --- a/test/plugs/plugs_test.py +++ b/test/plugs/plugs_test.py @@ -14,7 +14,6 @@ import threading import time -import unittest from openhtf import plugs from openhtf.core import base_plugs diff --git a/test/test_state_test.py b/test/test_state_test.py index bd916a5fd..3e6287181 100644 --- a/test/test_state_test.py +++ b/test/test_state_test.py @@ -16,10 +16,10 @@ import logging import sys import tempfile -import unittest from unittest import mock from absl.testing import parameterized + import openhtf from openhtf.core import phase_collections from openhtf.core import phase_descriptor @@ -37,7 +37,6 @@ @openhtf.PhaseOptions(name='test_phase') def test_phase(): """Test docstring.""" - pass PHASE_STATE_BASE_TYPE_INITIAL = { diff --git a/test/util/data_test.py b/test/util/data_test.py index 89dedf374..4623adb36 100644 --- a/test/util/data_test.py +++ b/test/util/data_test.py @@ -16,6 +16,7 @@ import unittest import attr + from openhtf.util import data diff --git a/test/util/test_test.py b/test/util/test_test.py index af139999a..621d293e3 100644 --- a/test/util/test_test.py +++ b/test/util/test_test.py @@ -22,7 +22,6 @@ from unittest import mock import openhtf - from openhtf import plugs from openhtf.core import base_plugs from openhtf.util import test diff --git a/test/util/text_test.py b/test/util/text_test.py index ff684d207..137e91eb0 100644 --- a/test/util/text_test.py +++ b/test/util/text_test.py @@ -17,11 +17,11 @@ import sys import types import typing -import unittest from unittest import mock from absl.testing import parameterized import colorama + import openhtf from openhtf.core import measurements from openhtf.core import phase_descriptor