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._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__ = [
|
__all__ = [
|
||||||
"__version__",
|
"__version__",
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import os
|
|
||||||
from itertools import chain
|
from itertools import chain
|
||||||
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Callable, Iterator
|
from typing import Callable
|
||||||
|
from typing import Iterator
|
||||||
|
|
||||||
|
|
||||||
def visit_path(
|
def visit_path(
|
||||||
|
|||||||
@@ -1,23 +1,22 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from enum import auto
|
||||||
|
from enum import Enum
|
||||||
|
from queue import Empty
|
||||||
|
from queue import Queue
|
||||||
import sys
|
import sys
|
||||||
from enum import Enum, auto
|
|
||||||
from typing import Sequence
|
from typing import Sequence
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from xdist.remote import Producer
|
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.workermanage import NodeManager
|
||||||
from xdist.scheduler import (
|
|
||||||
EachScheduling,
|
|
||||||
LoadScheduling,
|
|
||||||
LoadScopeScheduling,
|
|
||||||
LoadFileScheduling,
|
|
||||||
LoadGroupScheduling,
|
|
||||||
WorkStealingScheduling,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
from queue import Empty, Queue
|
|
||||||
|
|
||||||
|
|
||||||
class Interrupted(KeyboardInterrupt):
|
class Interrupted(KeyboardInterrupt):
|
||||||
|
|||||||
@@ -9,13 +9,14 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Dict, Sequence
|
|
||||||
|
|
||||||
import pytest
|
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
import execnet
|
from typing import Dict
|
||||||
|
from typing import Sequence
|
||||||
|
|
||||||
from _pytest._io import TerminalWriter
|
from _pytest._io import TerminalWriter
|
||||||
|
import execnet
|
||||||
|
import pytest
|
||||||
|
|
||||||
from xdist._path import visit_path
|
from xdist._path import visit_path
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import os
|
import os
|
||||||
import uuid
|
|
||||||
import sys
|
import sys
|
||||||
|
import uuid
|
||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|||||||
@@ -7,15 +7,16 @@
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import contextlib
|
import contextlib
|
||||||
import sys
|
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
import time
|
import time
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
import pytest
|
|
||||||
from execnet.gateway_base import dumps, DumpError
|
|
||||||
|
|
||||||
from _pytest.config import _prepareconfig
|
from _pytest.config import _prepareconfig
|
||||||
|
from execnet.gateway_base import DumpError
|
||||||
|
from execnet.gateway_base import dumps
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from setproctitle import setproctitle
|
from setproctitle import setproctitle
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
from xdist.scheduler.each import EachScheduling # noqa
|
from xdist.scheduler.each import EachScheduling as EachScheduling
|
||||||
from xdist.scheduler.load import LoadScheduling # noqa
|
from xdist.scheduler.load import LoadScheduling as LoadScheduling
|
||||||
from xdist.scheduler.loadfile import LoadFileScheduling # noqa
|
from xdist.scheduler.loadfile import LoadFileScheduling as LoadFileScheduling
|
||||||
from xdist.scheduler.loadscope import LoadScopeScheduling # noqa
|
from xdist.scheduler.loadgroup import LoadGroupScheduling as LoadGroupScheduling
|
||||||
from xdist.scheduler.loadgroup import LoadGroupScheduling # noqa
|
from xdist.scheduler.loadscope import LoadScopeScheduling as LoadScopeScheduling
|
||||||
from xdist.scheduler.worksteal import WorkStealingScheduling # noqa
|
from xdist.scheduler.worksteal import WorkStealingScheduling as WorkStealingScheduling
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
from xdist.remote import Producer
|
from xdist.remote import Producer
|
||||||
from xdist.workermanage import parse_spec_config
|
|
||||||
from xdist.report import report_collection_diff
|
from xdist.report import report_collection_diff
|
||||||
|
from xdist.workermanage import parse_spec_config
|
||||||
|
|
||||||
|
|
||||||
class EachScheduling:
|
class EachScheduling:
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ from itertools import cycle
|
|||||||
from _pytest.runner import CollectReport
|
from _pytest.runner import CollectReport
|
||||||
|
|
||||||
from xdist.remote import Producer
|
from xdist.remote import Producer
|
||||||
from xdist.workermanage import parse_spec_config
|
|
||||||
from xdist.report import report_collection_diff
|
from xdist.report import report_collection_diff
|
||||||
|
from xdist.workermanage import parse_spec_config
|
||||||
|
|
||||||
|
|
||||||
class LoadScheduling:
|
class LoadScheduling:
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
from .loadscope import LoadScopeScheduling
|
|
||||||
from xdist.remote import Producer
|
from xdist.remote import Producer
|
||||||
|
|
||||||
|
from .loadscope import LoadScopeScheduling
|
||||||
|
|
||||||
|
|
||||||
class LoadFileScheduling(LoadScopeScheduling):
|
class LoadFileScheduling(LoadScopeScheduling):
|
||||||
"""Implement load scheduling across nodes, but grouping test test file.
|
"""Implement load scheduling across nodes, but grouping test test file.
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
from .loadscope import LoadScopeScheduling
|
|
||||||
from xdist.remote import Producer
|
from xdist.remote import Producer
|
||||||
|
|
||||||
|
from .loadscope import LoadScopeScheduling
|
||||||
|
|
||||||
|
|
||||||
class LoadGroupScheduling(LoadScopeScheduling):
|
class LoadGroupScheduling(LoadScopeScheduling):
|
||||||
"""Implement load scheduling across nodes, but grouping test by xdist_group mark.
|
"""Implement load scheduling across nodes, but grouping test by xdist_group mark.
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
|
||||||
from _pytest.runner import CollectReport
|
from _pytest.runner import CollectReport
|
||||||
|
|
||||||
from xdist.remote import Producer
|
from xdist.remote import Producer
|
||||||
from xdist.report import report_collection_diff
|
from xdist.report import report_collection_diff
|
||||||
from xdist.workermanage import parse_spec_config
|
from xdist.workermanage import parse_spec_config
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ from collections import namedtuple
|
|||||||
from _pytest.runner import CollectReport
|
from _pytest.runner import CollectReport
|
||||||
|
|
||||||
from xdist.remote import Producer
|
from xdist.remote import Producer
|
||||||
from xdist.workermanage import parse_spec_config
|
|
||||||
from xdist.report import report_collection_diff
|
from xdist.report import report_collection_diff
|
||||||
|
from xdist.workermanage import parse_spec_config
|
||||||
|
|
||||||
|
|
||||||
NodePending = namedtuple("NodePending", ["node", "pending"])
|
NodePending = namedtuple("NodePending", ["node", "pending"])
|
||||||
|
|||||||
@@ -1,17 +1,23 @@
|
|||||||
import fnmatch
|
import fnmatch
|
||||||
import os
|
import os
|
||||||
|
from pathlib import Path
|
||||||
import re
|
import re
|
||||||
import sys
|
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
|
import uuid
|
||||||
from pathlib import Path
|
|
||||||
from typing import List, Union, Sequence, Optional, Any, Tuple, Set
|
|
||||||
|
|
||||||
import pytest
|
|
||||||
import execnet
|
import execnet
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
from xdist.plugin import _sys_path
|
||||||
import xdist.remote
|
import xdist.remote
|
||||||
from xdist.remote import Producer
|
from xdist.remote import Producer
|
||||||
from xdist.plugin import _sys_path
|
|
||||||
|
|
||||||
|
|
||||||
def parse_spec_config(config):
|
def parse_spec_config(config):
|
||||||
@@ -89,8 +95,8 @@ class NodeManager:
|
|||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
return []
|
return []
|
||||||
import pytest
|
|
||||||
import _pytest
|
import _pytest
|
||||||
|
import pytest
|
||||||
|
|
||||||
def get_dir(p):
|
def get_dir(p):
|
||||||
"""Return the directory path if p is a package or the path to the .py file otherwise."""
|
"""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):
|
def unserialize_warning_message(data):
|
||||||
import warnings
|
|
||||||
import importlib
|
import importlib
|
||||||
|
import warnings
|
||||||
|
|
||||||
if data["message_module"]:
|
if data["message_module"]:
|
||||||
mod = importlib.import_module(data["message_module"])
|
mod = importlib.import_module(data["message_module"])
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ from typing import List
|
|||||||
from typing import Tuple
|
from typing import Tuple
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
import xdist
|
import xdist
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
import execnet
|
|
||||||
import pytest
|
|
||||||
import shutil
|
import shutil
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
|
import execnet
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
pytest_plugins = "pytester"
|
pytest_plugins = "pytester"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,18 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
from xdist.dsession import (
|
|
||||||
DSession,
|
|
||||||
get_default_max_worker_restart,
|
|
||||||
get_workers_status_line,
|
|
||||||
WorkerStatus,
|
|
||||||
)
|
|
||||||
from xdist.report import report_collection_diff
|
|
||||||
from xdist.scheduler import EachScheduling, LoadScheduling, WorkStealingScheduling
|
|
||||||
from typing import Sequence
|
from typing import Sequence
|
||||||
|
|
||||||
import pytest
|
|
||||||
import execnet
|
import execnet
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
from xdist.dsession import DSession
|
||||||
|
from xdist.dsession import get_default_max_worker_restart
|
||||||
|
from xdist.dsession import get_workers_status_line
|
||||||
|
from xdist.dsession import WorkerStatus
|
||||||
|
from xdist.report import report_collection_diff
|
||||||
|
from xdist.scheduler import EachScheduling
|
||||||
|
from xdist.scheduler import LoadScheduling
|
||||||
|
from xdist.scheduler import WorkStealingScheduling
|
||||||
|
|
||||||
|
|
||||||
class MockGateway:
|
class MockGateway:
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import pathlib
|
import pathlib
|
||||||
|
from pathlib import Path
|
||||||
|
import shutil
|
||||||
import tempfile
|
import tempfile
|
||||||
import unittest.mock
|
import textwrap
|
||||||
from typing import List
|
from typing import List
|
||||||
|
import unittest.mock
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import shutil
|
|
||||||
import textwrap
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
from xdist.looponfail import RemoteControl
|
from xdist.looponfail import RemoteControl
|
||||||
from xdist.looponfail import StatRecorder
|
from xdist.looponfail import StatRecorder
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
from contextlib import suppress
|
from contextlib import suppress
|
||||||
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import sys
|
import sys
|
||||||
import os
|
|
||||||
|
|
||||||
import execnet
|
import execnet
|
||||||
from xdist.workermanage import NodeManager
|
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
from xdist.workermanage import NodeManager
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def monkeypatch_3_cpus(monkeypatch: pytest.MonkeyPatch):
|
def monkeypatch_3_cpus(monkeypatch: pytest.MonkeyPatch):
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
|
import marshal
|
||||||
import pprint
|
import pprint
|
||||||
import pytest
|
from queue import Queue
|
||||||
import sys
|
import sys
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from xdist.workermanage import WorkerController
|
|
||||||
import execnet
|
import execnet
|
||||||
import marshal
|
import pytest
|
||||||
|
|
||||||
|
from xdist.workermanage import WorkerController
|
||||||
|
|
||||||
from queue import Queue
|
|
||||||
|
|
||||||
WAIT_TIMEOUT = 10.0
|
WAIT_TIMEOUT = 10.0
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,19 @@
|
|||||||
import execnet
|
from pathlib import Path
|
||||||
import pytest
|
|
||||||
import shutil
|
import shutil
|
||||||
import textwrap
|
import textwrap
|
||||||
import warnings
|
import warnings
|
||||||
from pathlib import Path
|
|
||||||
|
import execnet
|
||||||
|
import pytest
|
||||||
from util import generate_warning
|
from util import generate_warning
|
||||||
|
|
||||||
from xdist import workermanage
|
from xdist import workermanage
|
||||||
from xdist._path import visit_path
|
from xdist._path import visit_path
|
||||||
from xdist.remote import serialize_warning_message
|
from xdist.remote import serialize_warning_message
|
||||||
from xdist.workermanage import HostRSync, NodeManager, unserialize_warning_message
|
from xdist.workermanage import HostRSync
|
||||||
|
from xdist.workermanage import NodeManager
|
||||||
|
from xdist.workermanage import unserialize_warning_message
|
||||||
|
|
||||||
|
|
||||||
pytest_plugins = "pytester"
|
pytest_plugins = "pytester"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user