Skip to content

Commit

Permalink
isort and black tests dir
Browse files Browse the repository at this point in the history
  • Loading branch information
ktbyers committed Oct 3, 2023
1 parent 6a9cef5 commit 4f1c0b2
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 28 deletions.
1 change: 1 addition & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os

import pytest

skip = pytest.mark.skipif(
Expand Down
22 changes: 11 additions & 11 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
from typing import List
import os
from typing import List

import pytest
import ruamel.yaml

from nornir.core import Nornir
from nornir.core.inventory import (
Inventory,
Host,
Hosts,
ConnectionOptions,
Defaults,
Group,
Groups,
Defaults,
Host,
Hosts,
Inventory,
ParentGroups,
ConnectionOptions,
)
from nornir.core.task import AggregatedResult, Task
from nornir.core.state import GlobalState

import ruamel.yaml
import pytest

from nornir.core.task import AggregatedResult, Task

global_data = GlobalState(dry_run=True)

Expand Down
4 changes: 2 additions & 2 deletions tests/core/test_InitNornir.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import logging
import logging.config
import os

import pytest

from nornir import InitNornir
from nornir.core.exceptions import ConflictingConfigurationWarning
from nornir.core.inventory import Inventory, Host, Hosts, Groups, Group, Defaults
from nornir.core.inventory import Defaults, Group, Groups, Host, Hosts, Inventory
from nornir.core.plugins.inventory import (
InventoryPluginRegister,
TransformFunctionRegister,
)


dir_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "test_InitNornir")

LOGGING_DICT = {
Expand Down
1 change: 0 additions & 1 deletion tests/core/test_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

from nornir.core.configuration import Config


dir_path = os.path.join(
os.path.dirname(os.path.realpath(__file__)), "test_configuration"
)
Expand Down
6 changes: 3 additions & 3 deletions tests/core/test_connections.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
from typing import Any, Dict, Optional

import pytest

from nornir.core.configuration import Config
from nornir.core.plugins.connections import ConnectionPluginRegister
from nornir.core.exceptions import (
ConnectionAlreadyOpen,
ConnectionNotOpen,
PluginAlreadyRegistered,
PluginNotRegistered,
)

import pytest
from nornir.core.plugins.connections import ConnectionPluginRegister


class DummyConnectionPlugin:
Expand Down
3 changes: 2 additions & 1 deletion tests/core/test_filter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pytest
from nornir.core.filter import F, AND, OR

from nornir.core.filter import AND, OR, F


class Test(object):
Expand Down
4 changes: 1 addition & 3 deletions tests/core/test_inventory.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import os

from nornir.core import inventory

import pytest

import ruamel.yaml

from nornir.core import inventory

yaml = ruamel.yaml.YAML(typ="safe")
dir_path = os.path.dirname(os.path.realpath(__file__))
Expand Down
5 changes: 2 additions & 3 deletions tests/core/test_registered_plugins.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
from nornir_utils.plugins.inventory import YAMLInventory

from nornir.core.plugins.inventory import InventoryPluginRegister
from nornir.core.plugins.runners import RunnersPluginRegister

from nornir.plugins.inventory import SimpleInventory
from nornir.plugins.runners import SerialRunner, ThreadedRunner

from nornir_utils.plugins.inventory import YAMLInventory


class Test:
def test_registered_runners(self):
Expand Down
2 changes: 1 addition & 1 deletion tests/core/test_tasks.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging

from nornir.core.task import Result
from nornir.core.exceptions import NornirSubTaskError
from nornir.core.task import Result


class CustomException(Exception):
Expand Down
5 changes: 2 additions & 3 deletions tests/plugins/processors/test_threaded.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import datetime
import time

from nornir.core.exceptions import NornirExecutionError
from nornir.plugins.runners import ThreadedRunner

import pytest

from nornir.core.exceptions import NornirExecutionError
from nornir.plugins.runners import ThreadedRunner

NUM_WORKERS = 20

Expand Down

0 comments on commit 4f1c0b2

Please sign in to comment.