Skip to content

Commit

Permalink
linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bschimke95 committed Nov 27, 2024
1 parent 01096ab commit 2b001de
Show file tree
Hide file tree
Showing 20 changed files with 22 additions and 27 deletions.
2 changes: 2 additions & 0 deletions tests/integration/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# into the harness instances to reduce the number of downloads.
PRELOADED_SNAPS = ["snapd", "core20"]


def pytest_collection_modifyitems(config, items):
"""
A hook to ensure all tests have at least one tag before execution.
Expand All @@ -37,6 +38,7 @@ def pytest_collection_modifyitems(config, items):
f"Please add at least one tag using @pytest.mark.tags."
)


def _harness_clean(h: harness.Harness):
"Clean up created instances within the test harness."

Expand Down
9 changes: 2 additions & 7 deletions tests/integration/tests/test_annotations.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
#
# Copyright 2024 Canonical, Ltd.
#
import datetime
import logging
import os
import subprocess
import tempfile
from typing import List

import pytest
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from test_util import config, harness, util, tags
from test_util import config, harness, tags, util

LOG = logging.getLogger(__name__)


@pytest.mark.node_count(3)
@pytest.mark.bootstrap_config(
(config.MANIFESTS_DIR / "bootstrap-no-k8s-node-remove.yaml").read_text()
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/tests/test_cilium_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from typing import List

import pytest
from test_util import config, harness, util, tags
from test_util import config, harness, tags, util

LOG = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/tests/test_cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from typing import List

import pytest
from test_util import harness, util, tags
from test_util import harness, tags, util

LOG = logging.getLogger(__name__)

Expand Down
4 changes: 1 addition & 3 deletions tests/integration/tests/test_clustering.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import pytest
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from test_util import config, harness, util, tags
from test_util import config, harness, tags, util

LOG = logging.getLogger(__name__)

Expand Down Expand Up @@ -100,8 +100,6 @@ def test_worker_nodes(instances: List[harness.Instance]):
], f"only {cluster_node.id} should be left in cluster"




@pytest.mark.node_count(3)
@pytest.mark.tags(tags.NIGHTLY)
def test_join_with_custom_token_name(instances: List[harness.Instance]):
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/tests/test_clustering_race.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import List

import pytest
from test_util import harness, util, tags
from test_util import harness, tags, util


@pytest.mark.node_count(3)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/tests/test_config_propagation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from typing import List

import pytest
from test_util import harness, util, tags
from test_util import harness, tags, util

LOG = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/tests/test_control_plane_taints.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typing import List

import pytest
from test_util import harness, util, tags
from test_util import harness, tags, util

LOG = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/tests/test_dns.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from typing import List

import pytest
from test_util import config, harness, util, tags
from test_util import config, harness, tags, util

LOG = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/tests/test_etcd.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import pytest
import yaml
from test_util import harness, util, tags
from test_util import harness, tags, util
from test_util.etcd import EtcdCluster

LOG = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/tests/test_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from typing import List

import pytest
from test_util import config, harness, util, tags
from test_util import config, harness, tags, util
from test_util.config import MANIFESTS_DIR

LOG = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/tests/test_ingress.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from typing import List

import pytest
from test_util import config, harness, util, tags
from test_util import config, harness, tags, util
from test_util.config import MANIFESTS_DIR

LOG = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/tests/test_loadbalancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typing import List

import pytest
from test_util import harness, util, tags
from test_util import harness, tags, util
from test_util.config import MANIFESTS_DIR

LOG = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/tests/test_metrics_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from typing import List

import pytest
from test_util import config, harness, util, tags
from test_util import config, harness, tags, util

LOG = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/tests/test_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from typing import List

import pytest
from test_util import config, harness, util, tags
from test_util import config, harness, tags, util
from test_util.config import MANIFESTS_DIR

LOG = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/tests/test_networking.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typing import List

import pytest
from test_util import config, harness, util, tags
from test_util import config, harness, tags, util

LOG = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/tests/test_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from typing import List

import pytest
from test_util import config, harness, util, tags
from test_util import config, harness, tags, util

LOG = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/tests/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from typing import List

import pytest
from test_util import config, harness, util, tags
from test_util import config, harness, tags, util
from test_util.config import MANIFESTS_DIR

LOG = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/tests/test_strict_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from typing import List

import pytest
from test_util import config, harness, snap, util, tags
from test_util import config, harness, snap, tags, util

LOG = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/tests/test_version_upgrades.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from typing import List

import pytest
from test_util import config, harness, snap, util, tags
from test_util import config, harness, snap, tags, util

LOG = logging.getLogger(__name__)

Expand Down

0 comments on commit 2b001de

Please sign in to comment.