Commit ef12a8f6 authored by Samuel GAIST's avatar Samuel GAIST

[test] Pre-commit cleanup

parent f0cede35
......@@ -40,9 +40,8 @@ usage: <script> 2
Runs 2x CPU stress function
"""
import sys
import multiprocessing
import sys
def test(x):
......
......@@ -34,8 +34,8 @@
###################################################################################
from ..data import DataSource
from ..data import DataSink
from ..data import DataSource
class MockDataSource(DataSource):
......
......@@ -36,11 +36,13 @@
import nose.tools
from ..algorithm import Algorithm, Storage
from ..library import Library, Storage as LibraryStorage
from ..algorithm import Algorithm
from ..algorithm import Storage
from ..dataformat import Storage as DataFormatStorage
from . import prefix, tmp_prefix
from ..library import Library
from ..library import Storage as LibraryStorage
from . import prefix
from . import tmp_prefix
from .utils import cleanup
......
......@@ -37,11 +37,10 @@
import nose.tools
from ..algorithm import Algorithm
from . import prefix, tmp_prefix
from . import prefix
from . import tmp_prefix
from .utils import cleanup
# ----------------------------------------------------------
......
......@@ -36,30 +36,27 @@
# Tests for experiment execution
import os
import unittest
import multiprocessing
import os
import queue
import zmq
import unittest
import simplejson as json
import zmq
from flaky import flaky
from ..bcp import broker
from ..bcp import worker
from ..bcpapi import BCP
from ..bcpapi.client import BeatComputationClient
from ..bcpapi.execution import ExecutionProcess
from ..bcpapi.processor import BeatComputationProcessor
from ..bcp import worker
from ..bcp import broker
from ..database import Database
from ..utils import find_free_port
from ..dock import Host
from . import prefix, tmp_prefix
from ..utils import find_free_port
from . import VERBOSE_BCP_LOGGING
from . import prefix
from . import tmp_prefix
# ----------------------------------------------------------
......
......@@ -35,9 +35,10 @@
import nose.tools
from ..database import Database
from . import prefix, tmp_prefix
from ..database import Database
from . import prefix
from . import tmp_prefix
from .utils import cleanup
......
......@@ -35,23 +35,20 @@
"""Asynchronous process I/O with the Subprocess module"""
import os
import time
import tempfile
import time
import unittest
import pkg_resources
from tempfile import TemporaryDirectory
from ..dock import Host
import pkg_resources
from ..dock import Host
from . import DOCKER_NETWORK_TEST_ENABLED
from . import network_name
from . import tmp_prefix
from .utils import slow
from .utils import skipif
from . import network_name
from . import DOCKER_NETWORK_TEST_ENABLED
from .utils import slow
class NoDiscoveryTests(unittest.TestCase):
......
......@@ -37,22 +37,21 @@
# Tests for experiment execution
import os
import shutil
import sys
import tempfile
import unittest
import simplejson as json
import tempfile
import shutil
import zmq
from beat.backend.python.database import Database
from beat.backend.python.data import RemoteDataSource
from beat.backend.python.database import Database
from ..dock import Host
from ..utils import find_free_port
from . import prefix
# ----------------------------------------------------------
......
......@@ -36,10 +36,8 @@
import unittest
from ..dock import Host
from .. import environments
from ..dock import Host
from .utils import slow
......
......@@ -38,22 +38,19 @@
import os
import subprocess # nosec
import nose.tools
from ..dock import Host
from ..execution import DockerExecutor
from .utils import cleanup
from .utils import slow
from .utils import skipif
from .test_execution import BaseExecutionMixIn
from . import DOCKER_NETWORK_TEST_ENABLED
from . import network_name
from . import prefix_folder
from . import DOCKER_NETWORK_TEST_ENABLED
from .test_execution import BaseExecutionMixIn
from .utils import DOCKER_TEST_IMAGES
from .utils import cleanup
from .utils import skipif
from .utils import slow
BUILDER_CONTAINER_NAME = "docker.idiap.ch/beat/beat.env.builder/beat.env.cxxdev"
BUILDER_IMAGE = (
......
......@@ -37,9 +37,8 @@
# Tests for experiment execution
from ..dock import Host
from .test_worker import TestOneWorker, TestTwoWorkers
from .test_worker import TestOneWorker
from .test_worker import TestTwoWorkers
# ----------------------------------------------------------
......
......@@ -36,26 +36,25 @@
# Tests for experiment execution
import os
import glob
import logging
import nose.tools
import os
import subprocess as sp # nosec
from shutil import rmtree
from ..experiment import Experiment
import nose.tools
from ..data import CachedDataSource
from ..execution import LocalExecutor
from ..execution import SubprocessExecutor
from ..hash import hashFileContents
from ..experiment import Experiment
from ..hash import hashDataset
from ..hash import hashFileContents
from ..hash import toPath
from ..data import CachedDataSource
from . import prefix, tmp_prefix
from . import prefix
from . import tmp_prefix
from .utils import slow
logger = logging.getLogger(__name__)
......
......@@ -34,14 +34,14 @@
###################################################################################
import six
import nose.tools
from ..experiment import Experiment
import six
from . import prefix, tmp_prefix
from ..experiment import Experiment
from . import prefix
from . import tmp_prefix
from .utils import cleanup
# ----------------------------------------------------------
......
......@@ -37,7 +37,6 @@
import nose.tools
from ..dataformat import DataFormat
from . import prefix
......
......@@ -34,11 +34,10 @@
###################################################################################
import numpy
import nose.tools
import numpy
from ..dataformat import DataFormat
from . import prefix
......
......@@ -37,10 +37,8 @@
import nose.tools
from ..dataformat import DataFormat
from . import prefix
# ----------------------------------------------------------
......
......@@ -34,13 +34,13 @@
###################################################################################
import six
import numpy
import nose.tools
import numpy
import six
from ..dataformat import DataFormat
from . import prefix, tmp_prefix
from . import prefix
from . import tmp_prefix
from .utils import cleanup
......
......@@ -35,8 +35,8 @@
import nose.tools
from .. import hash
from .. import hash
# ----------------------------------------------------------
......
......@@ -34,13 +34,13 @@
###################################################################################
import logging
import nose.tools
from ..database import Database
from ..database import Database
from . import prefix
import logging
logger = logging.getLogger(__name__)
......
......@@ -39,9 +39,11 @@ import types
import nose.tools
from . import prefix, tmp_prefix
from ..library import Library
from ..library import Storage
from . import prefix
from . import tmp_prefix
from .utils import cleanup
from ..library import Library, Storage
def test_valid():
......
......@@ -39,7 +39,6 @@ import imghdr
import nose.tools
from ..plotter import Plotter
from . import prefix
......
......@@ -37,7 +37,6 @@ import nose.tools
from ..plotterparameter import Plotterparameter
from ..plotterparameter import Storage
from . import prefix
......
......@@ -35,9 +35,10 @@
import nose.tools
from ..protocoltemplate import ProtocolTemplate
from . import prefix, tmp_prefix
from ..protocoltemplate import ProtocolTemplate
from . import prefix
from . import tmp_prefix
from .utils import cleanup
......
......@@ -35,6 +35,7 @@
import nose.tools
from ..stats import Statistics
......
......@@ -35,14 +35,14 @@
import nose.tools
from ..toolchain import Toolchain
from ..toolchain import Toolchain
from . import prefix
def count_errors(l, e):
def count_errors(error_list, error):
"""Makes sure a given string is present in one of the errors"""
return sum([int(k.find(e) != -1) for k in l])
return sum([int(item.find(error) != -1) for item in error_list])
def test_load_default():
......
......@@ -35,8 +35,8 @@
import nose.tools
from ..toolchain import Toolchain
from ..toolchain import Toolchain
from . import prefix
......
......@@ -36,25 +36,23 @@
# Tests for experiment execution
import os
import unittest
import simplejson as json
import multiprocessing
import os
import queue
from time import time
import unittest
from time import sleep
from time import time
import simplejson as json
from ddt import ddt
from ddt import idata
from ..scripts import worker
from ..worker import WorkerController
from ..database import Database
from ..scripts import worker
from ..utils import find_free_port
from . import prefix, tmp_prefix
from ..worker import WorkerController
from . import prefix
from . import tmp_prefix
# ----------------------------------------------------------
......
......@@ -35,13 +35,11 @@
"""Decorators for test units"""
import os
import shutil
import nose
import docker
import nose
# ----------------------------------------------------------
......@@ -207,7 +205,8 @@ def skipif(skip_condition, msg=None):
def cleanup():
from . import prefix, tmp_prefix
from . import prefix
from . import tmp_prefix
cache_path = os.path.join(prefix, "cache")
if os.path.exists(cache_path):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment