diff --git a/tests/conftest.py b/tests/conftest.py index ced61be0f0f8..98f4c43ca833 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,8 +1,6 @@ # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 -# Pytest fixtures and redefined-outer-name don't mix well. Disable it. -# pylint:disable=redefined-outer-name # We import some fixtures that are unused. Disable that too. # pylint:disable=unused-import diff --git a/tests/host_tools/ip_generator.py b/tests/host_tools/ip_generator.py index ab93b9c386ce..0d09182be1ef 100644 --- a/tests/host_tools/ip_generator.py +++ b/tests/host_tools/ip_generator.py @@ -1,8 +1,6 @@ # Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 -# pylint:disable=redefined-outer-name - """ Each microVM needs to have a unique IP on the host network, or there will be conflicts. diff --git a/tests/integration_tests/functional/test_drives.py b/tests/integration_tests/functional/test_drives.py index fa5a254f2218..a9f0d49d112d 100644 --- a/tests/integration_tests/functional/test_drives.py +++ b/tests/integration_tests/functional/test_drives.py @@ -2,8 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 """Tests for guest-side operations on /drives resources.""" -# pylint:disable=redefined-outer-name - import os from subprocess import check_output diff --git a/tests/integration_tests/functional/test_rng.py b/tests/integration_tests/functional/test_rng.py index 2bae5987ca52..54da6291cc22 100644 --- a/tests/integration_tests/functional/test_rng.py +++ b/tests/integration_tests/functional/test_rng.py @@ -2,8 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 """Tests for the virtio-rng device""" -# pylint:disable=redefined-outer-name - import pytest from framework.properties import global_props diff --git a/tests/integration_tests/performance/conftest.py b/tests/integration_tests/performance/conftest.py index c54bccf9f29c..9e69d764f864 100644 --- a/tests/integration_tests/performance/conftest.py +++ b/tests/integration_tests/performance/conftest.py @@ -1,9 +1,6 @@ # Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 -# Pytest fixtures and redefined-outer-name don't mix well. Disable it. -# pylint:disable=redefined-outer-name - """Fixtures for performance tests""" import json diff --git a/tests/integration_tests/performance/test_boottime.py b/tests/integration_tests/performance/test_boottime.py index 6042eeb1d061..561bb0d5190c 100644 --- a/tests/integration_tests/performance/test_boottime.py +++ b/tests/integration_tests/performance/test_boottime.py @@ -2,8 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 """Tests that ensure the boot time to init process is within spec.""" -# pylint:disable=redefined-outer-name - import re import time diff --git a/tests/integration_tests/performance/test_process_startup_time.py b/tests/integration_tests/performance/test_process_startup_time.py index 7daf7a81143d..b17cd70ebed3 100644 --- a/tests/integration_tests/performance/test_process_startup_time.py +++ b/tests/integration_tests/performance/test_process_startup_time.py @@ -2,8 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 """Test that the process startup time up to socket bind is within spec.""" -# pylint: disable=redefined-outer-name - import os import time diff --git a/tests/integration_tests/security/test_jail.py b/tests/integration_tests/security/test_jail.py index 7eb5dc319cf8..465c38713d71 100644 --- a/tests/integration_tests/security/test_jail.py +++ b/tests/integration_tests/security/test_jail.py @@ -2,8 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 """Tests that verify the jailer's behavior.""" -# pylint: disable=redefined-outer-name - import functools import http.client as http_client import os diff --git a/tests/integration_tests/security/test_seccomp.py b/tests/integration_tests/security/test_seccomp.py index 5a0b3e138844..e38af59f9daf 100644 --- a/tests/integration_tests/security/test_seccomp.py +++ b/tests/integration_tests/security/test_seccomp.py @@ -90,7 +90,6 @@ def test_seccomp_ls(bin_seccomp_paths): """ Assert that the seccomp filter denies an unallowed syscall. """ - # pylint: disable=redefined-outer-name # pylint: disable=subprocess-run-check # The fixture pattern causes a pylint false positive for that rule. @@ -135,7 +134,6 @@ def test_advanced_seccomp(bin_seccomp_paths): binary, denies the malicious demo binary and that an empty allowlist denies everything. """ - # pylint: disable=redefined-outer-name # pylint: disable=subprocess-run-check # The fixture pattern causes a pylint false positive for that rule. @@ -272,7 +270,6 @@ def test_seccomp_rust_panic(bin_seccomp_paths): Test that the Firecracker filters allow a Rust panic to run its course without triggering a seccomp violation. """ - # pylint: disable=redefined-outer-name # pylint: disable=subprocess-run-check # The fixture pattern causes a pylint false positive for that rule. diff --git a/tests/integration_tests/security/test_vulnerabilities.py b/tests/integration_tests/security/test_vulnerabilities.py index 9acd6511c3b9..54acef5b0a08 100644 --- a/tests/integration_tests/security/test_vulnerabilities.py +++ b/tests/integration_tests/security/test_vulnerabilities.py @@ -31,9 +31,6 @@ VULN_DIR = "/sys/devices/system/cpu/vulnerabilities" -# This lint doesnt work well with fixtures -# pylint:disable=redefined-outer-name - def configure_microvm( factory, diff --git a/tests/integration_tests/style/test_python.py b/tests/integration_tests/style/test_python.py index 31e77fb8c74c..587083b7d95f 100644 --- a/tests/integration_tests/style/test_python.py +++ b/tests/integration_tests/style/test_python.py @@ -35,7 +35,7 @@ def test_python_pylint(): '--variable-rgx="[a-z_][a-z0-9_]{1,30}$" --disable=' "fixme,too-many-instance-attributes,import-error," "too-many-locals,too-many-arguments,consider-using-f-string," - "consider-using-with,implicit-str-concat,line-too-long," + "consider-using-with,implicit-str-concat,line-too-long,redefined-outer-name," "broad-exception-raised,duplicate-code tests tools .buildkite/*.py" ) run(