Sort imports
Using pytest's style.
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
from xdist.plugin import (
|
||||
is_xdist_worker,
|
||||
is_xdist_master,
|
||||
get_xdist_worker_id,
|
||||
is_xdist_controller,
|
||||
)
|
||||
from xdist._version import version as __version__
|
||||
from xdist.plugin import get_xdist_worker_id
|
||||
from xdist.plugin import is_xdist_controller
|
||||
from xdist.plugin import is_xdist_master
|
||||
from xdist.plugin import is_xdist_worker
|
||||
|
||||
|
||||
__all__ = [
|
||||
"__version__",
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import os
|
||||
from itertools import chain
|
||||
import os
|
||||
from pathlib import Path
|
||||
from typing import Callable, Iterator
|
||||
from typing import Callable
|
||||
from typing import Iterator
|
||||
|
||||
|
||||
def visit_path(
|
||||
|
||||
@@ -1,23 +1,22 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from enum import auto
|
||||
from enum import Enum
|
||||
from queue import Empty
|
||||
from queue import Queue
|
||||
import sys
|
||||
from enum import Enum, auto
|
||||
from typing import Sequence
|
||||
|
||||
import pytest
|
||||
|
||||
from xdist.remote import Producer
|
||||
from xdist.scheduler import EachScheduling
|
||||
from xdist.scheduler import LoadFileScheduling
|
||||
from xdist.scheduler import LoadGroupScheduling
|
||||
from xdist.scheduler import LoadScheduling
|
||||
from xdist.scheduler import LoadScopeScheduling
|
||||
from xdist.scheduler import WorkStealingScheduling
|
||||
from xdist.workermanage import NodeManager
|
||||
from xdist.scheduler import (
|
||||
EachScheduling,
|
||||
LoadScheduling,
|
||||
LoadScopeScheduling,
|
||||
LoadFileScheduling,
|
||||
LoadGroupScheduling,
|
||||
WorkStealingScheduling,
|
||||
)
|
||||
|
||||
|
||||
from queue import Empty, Queue
|
||||
|
||||
|
||||
class Interrupted(KeyboardInterrupt):
|
||||
|
||||
@@ -9,13 +9,14 @@
|
||||
|
||||
import os
|
||||
from pathlib import Path
|
||||
from typing import Dict, Sequence
|
||||
|
||||
import pytest
|
||||
import sys
|
||||
import time
|
||||
import execnet
|
||||
from typing import Dict
|
||||
from typing import Sequence
|
||||
|
||||
from _pytest._io import TerminalWriter
|
||||
import execnet
|
||||
import pytest
|
||||
|
||||
from xdist._path import visit_path
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import os
|
||||
import uuid
|
||||
import sys
|
||||
import uuid
|
||||
import warnings
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -7,15 +7,16 @@
|
||||
"""
|
||||
|
||||
import contextlib
|
||||
import sys
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
from typing import Any
|
||||
|
||||
import pytest
|
||||
from execnet.gateway_base import dumps, DumpError
|
||||
|
||||
from _pytest.config import _prepareconfig
|
||||
from execnet.gateway_base import DumpError
|
||||
from execnet.gateway_base import dumps
|
||||
import pytest
|
||||
|
||||
|
||||
try:
|
||||
from setproctitle import setproctitle
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from xdist.scheduler.each import EachScheduling # noqa
|
||||
from xdist.scheduler.load import LoadScheduling # noqa
|
||||
from xdist.scheduler.loadfile import LoadFileScheduling # noqa
|
||||
from xdist.scheduler.loadscope import LoadScopeScheduling # noqa
|
||||
from xdist.scheduler.loadgroup import LoadGroupScheduling # noqa
|
||||
from xdist.scheduler.worksteal import WorkStealingScheduling # noqa
|
||||
from xdist.scheduler.each import EachScheduling as EachScheduling
|
||||
from xdist.scheduler.load import LoadScheduling as LoadScheduling
|
||||
from xdist.scheduler.loadfile import LoadFileScheduling as LoadFileScheduling
|
||||
from xdist.scheduler.loadgroup import LoadGroupScheduling as LoadGroupScheduling
|
||||
from xdist.scheduler.loadscope import LoadScopeScheduling as LoadScopeScheduling
|
||||
from xdist.scheduler.worksteal import WorkStealingScheduling as WorkStealingScheduling
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from xdist.remote import Producer
|
||||
from xdist.workermanage import parse_spec_config
|
||||
from xdist.report import report_collection_diff
|
||||
from xdist.workermanage import parse_spec_config
|
||||
|
||||
|
||||
class EachScheduling:
|
||||
|
||||
@@ -3,8 +3,8 @@ from itertools import cycle
|
||||
from _pytest.runner import CollectReport
|
||||
|
||||
from xdist.remote import Producer
|
||||
from xdist.workermanage import parse_spec_config
|
||||
from xdist.report import report_collection_diff
|
||||
from xdist.workermanage import parse_spec_config
|
||||
|
||||
|
||||
class LoadScheduling:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from .loadscope import LoadScopeScheduling
|
||||
from xdist.remote import Producer
|
||||
|
||||
from .loadscope import LoadScopeScheduling
|
||||
|
||||
|
||||
class LoadFileScheduling(LoadScopeScheduling):
|
||||
"""Implement load scheduling across nodes, but grouping test test file.
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from .loadscope import LoadScopeScheduling
|
||||
from xdist.remote import Producer
|
||||
|
||||
from .loadscope import LoadScopeScheduling
|
||||
|
||||
|
||||
class LoadGroupScheduling(LoadScopeScheduling):
|
||||
"""Implement load scheduling across nodes, but grouping test by xdist_group mark.
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from collections import OrderedDict
|
||||
|
||||
from _pytest.runner import CollectReport
|
||||
|
||||
from xdist.remote import Producer
|
||||
from xdist.report import report_collection_diff
|
||||
from xdist.workermanage import parse_spec_config
|
||||
|
||||
@@ -3,8 +3,8 @@ from collections import namedtuple
|
||||
from _pytest.runner import CollectReport
|
||||
|
||||
from xdist.remote import Producer
|
||||
from xdist.workermanage import parse_spec_config
|
||||
from xdist.report import report_collection_diff
|
||||
from xdist.workermanage import parse_spec_config
|
||||
|
||||
|
||||
NodePending = namedtuple("NodePending", ["node", "pending"])
|
||||
|
||||
@@ -1,17 +1,23 @@
|
||||
import fnmatch
|
||||
import os
|
||||
from pathlib import Path
|
||||
import re
|
||||
import sys
|
||||
from typing import Any
|
||||
from typing import List
|
||||
from typing import Optional
|
||||
from typing import Sequence
|
||||
from typing import Set
|
||||
from typing import Tuple
|
||||
from typing import Union
|
||||
import uuid
|
||||
from pathlib import Path
|
||||
from typing import List, Union, Sequence, Optional, Any, Tuple, Set
|
||||
|
||||
import pytest
|
||||
import execnet
|
||||
import pytest
|
||||
|
||||
from xdist.plugin import _sys_path
|
||||
import xdist.remote
|
||||
from xdist.remote import Producer
|
||||
from xdist.plugin import _sys_path
|
||||
|
||||
|
||||
def parse_spec_config(config):
|
||||
@@ -89,8 +95,8 @@ class NodeManager:
|
||||
break
|
||||
else:
|
||||
return []
|
||||
import pytest
|
||||
import _pytest
|
||||
import pytest
|
||||
|
||||
def get_dir(p):
|
||||
"""Return the directory path if p is a package or the path to the .py file otherwise."""
|
||||
@@ -405,8 +411,8 @@ class WorkerController:
|
||||
|
||||
|
||||
def unserialize_warning_message(data):
|
||||
import warnings
|
||||
import importlib
|
||||
import warnings
|
||||
|
||||
if data["message_module"]:
|
||||
mod = importlib.import_module(data["message_module"])
|
||||
|
||||
Reference in New Issue
Block a user