Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add inline noqa suppression directives #5157

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tests/integrationv2/test_buffered_send.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
MINIMAL_TEST_CERTS,
)
from common import ProviderOptions, data_bytes
from fixtures import managed_process # lgtm [py/unused-import]
from fixtures import managed_process # lgtm [py/unused-import] # noqa: F401
from providers import Provider, S2N, OpenSSL, GnuTLS
from utils import invalid_test_parameters, get_parameter_name, to_bytes, to_string

Expand Down Expand Up @@ -39,7 +39,7 @@
FRAGMENT_PREFERENCE = [None, "--prefer-low-latency", "--prefer-throughput"]


def test_SEND_BUFFER_SIZE_MIN_is_s2ns_min_buffer_size(managed_process):
def test_SEND_BUFFER_SIZE_MIN_is_s2ns_min_buffer_size(managed_process): # noqa: F811
port = next(available_ports)

s2n_options = ProviderOptions(
Expand Down Expand Up @@ -73,7 +73,7 @@ def test_SEND_BUFFER_SIZE_MIN_is_s2ns_min_buffer_size(managed_process):
"fragment_preference", FRAGMENT_PREFERENCE, ids=get_parameter_name
)
def test_s2n_server_buffered_send(
managed_process,
managed_process, # noqa: F811
cipher,
provider,
protocol,
Expand Down Expand Up @@ -141,7 +141,7 @@ def test_s2n_server_buffered_send(
"fragment_preference", FRAGMENT_PREFERENCE, ids=get_parameter_name
)
def test_s2n_client_buffered_send(
managed_process,
managed_process, # noqa: F811
cipher,
provider,
protocol,
Expand Down
17 changes: 11 additions & 6 deletions tests/integrationv2/test_client_authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from configuration import available_ports, ALL_TEST_CIPHERS, PROTOCOLS
from common import Certificates, ProviderOptions, Protocols, data_bytes, Signatures
from fixtures import managed_process # lgtm [py/unused-import]
from fixtures import managed_process # lgtm [py/unused-import] # noqa: F401
from providers import Provider, S2N, GnuTLS, OpenSSL
from utils import (
invalid_test_parameters,
Expand Down Expand Up @@ -58,7 +58,7 @@ def assert_s2n_handshake_complete(results, protocol, provider, is_complete=True)
@pytest.mark.parametrize("certificate", CERTS_TO_TEST, ids=get_parameter_name)
@pytest.mark.parametrize("client_certificate", CERTS_TO_TEST, ids=get_parameter_name)
def test_client_auth_with_s2n_server(
managed_process,
managed_process, # noqa: F811
provider,
other_provider,
protocol,
Expand Down Expand Up @@ -114,7 +114,7 @@ def test_client_auth_with_s2n_server(
@pytest.mark.parametrize("certificate", CERTS_TO_TEST, ids=get_parameter_name)
@pytest.mark.parametrize("client_certificate", CERTS_TO_TEST, ids=get_parameter_name)
def test_client_auth_with_s2n_server_using_nonmatching_certs(
managed_process,
managed_process, # noqa: F811
provider,
other_provider,
protocol,
Expand Down Expand Up @@ -175,7 +175,12 @@ def test_client_auth_with_s2n_server_using_nonmatching_certs(
@pytest.mark.parametrize("cipher", ALL_TEST_CIPHERS, ids=get_parameter_name)
@pytest.mark.parametrize("certificate", CERTS_TO_TEST, ids=get_parameter_name)
def test_client_auth_with_s2n_client_no_cert(
managed_process, provider, other_provider, protocol, cipher, certificate
managed_process,
provider,
other_provider,
protocol,
cipher,
certificate, # noqa: F811
):
port = next(available_ports)

Expand Down Expand Up @@ -225,7 +230,7 @@ def test_client_auth_with_s2n_client_no_cert(
@pytest.mark.parametrize("certificate", CERTS_TO_TEST, ids=get_parameter_name)
@pytest.mark.parametrize("client_certificate", CERTS_TO_TEST, ids=get_parameter_name)
def test_client_auth_with_s2n_client_with_cert(
managed_process,
managed_process, # noqa: F811
provider,
other_provider,
protocol,
Expand Down Expand Up @@ -289,7 +294,7 @@ def test_client_auth_with_s2n_client_with_cert(
[Certificates.RSA_2048_PKCS1, Certificates.ECDSA_256],
ids=get_parameter_name,
)
def test_tls_12_client_auth_downgrade(managed_process, certificate):
def test_tls_12_client_auth_downgrade(managed_process, certificate): # noqa: F811
port = next(available_ports)

random_bytes = data_bytes(64)
Expand Down
10 changes: 5 additions & 5 deletions tests/integrationv2/test_cross_compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
ALL_TEST_CERTS,
)
from common import ProviderOptions, Protocols, data_bytes
from fixtures import managed_process # lgtm [py/unused-import]
from fixtures import managed_process # lgtm [py/unused-import] # noqa: F401
from providers import Provider, S2N, OpenSSL
from utils import invalid_test_parameters, get_parameter_name, to_bytes

Expand All @@ -36,7 +36,7 @@
@pytest.mark.parametrize("provider", [OpenSSL], ids=get_parameter_name)
@pytest.mark.parametrize("other_provider", [S2N], ids=get_parameter_name)
def test_s2n_old_server_new_ticket(
managed_process,
managed_process, # noqa: F811
tmp_path,
cipher,
curve,
Expand Down Expand Up @@ -109,7 +109,7 @@ def test_s2n_old_server_new_ticket(
@pytest.mark.parametrize("provider", [OpenSSL], ids=get_parameter_name)
@pytest.mark.parametrize("other_provider", [S2N], ids=get_parameter_name)
def test_s2n_new_server_old_ticket(
managed_process,
managed_process, # noqa: F811
tmp_path,
cipher,
curve,
Expand Down Expand Up @@ -184,7 +184,7 @@ def test_s2n_new_server_old_ticket(
@pytest.mark.parametrize("provider", [S2N], ids=get_parameter_name)
@pytest.mark.parametrize("other_provider", [S2N], ids=get_parameter_name)
def test_s2n_old_client_new_ticket(
managed_process,
managed_process, # noqa: F811
tmp_path,
cipher,
curve,
Expand Down Expand Up @@ -253,7 +253,7 @@ def test_s2n_old_client_new_ticket(
@pytest.mark.parametrize("provider", [S2N], ids=get_parameter_name)
@pytest.mark.parametrize("other_provider", [S2N], ids=get_parameter_name)
def test_s2n_new_client_old_ticket(
managed_process,
managed_process, # noqa: F811
tmp_path,
cipher,
curve,
Expand Down
9 changes: 6 additions & 3 deletions tests/integrationv2/test_dynamic_record_sizes.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
PROTOCOLS,
)
from common import ProviderOptions, data_bytes
from fixtures import custom_mtu, managed_process # lgtm [py/unused-import]
from fixtures import (
custom_mtu,
managed_process,
) # lgtm [py/unused-import] # noqa: F401
from providers import Provider, S2N, OpenSSL, Tcpdump
from utils import (
invalid_test_parameters,
Expand Down Expand Up @@ -56,8 +59,8 @@ def find_fragmented_packet(results):
@pytest.mark.parametrize("protocol", PROTOCOLS, ids=get_parameter_name)
@pytest.mark.parametrize("certificate", ALL_TEST_CERTS, ids=get_parameter_name)
def test_s2n_client_dynamic_record(
custom_mtu,
managed_process,
custom_mtu, # noqa: F811
managed_process, # noqa: F811
cipher,
curve,
provider,
Expand Down
24 changes: 15 additions & 9 deletions tests/integrationv2/test_early_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
TLS13_CIPHERS,
)
from common import ProviderOptions, Protocols, Curves, data_bytes
from fixtures import managed_process # lgtm [py/unused-import]
from fixtures import managed_process # lgtm [py/unused-import] # noqa: F401
from providers import Provider, S2N as S2NBase, OpenSSL as OpenSSLBase
from utils import invalid_test_parameters, get_parameter_name, to_bytes

Expand Down Expand Up @@ -97,7 +97,7 @@ def get_early_data_bytes(file_path, early_data_size):
return early_data


def get_ticket_from_s2n_server(options, managed_process, provider, certificate):
def get_ticket_from_s2n_server(options, managed_process, provider, certificate): # noqa: F811
port = next(available_ports)

"""
Expand Down Expand Up @@ -165,7 +165,7 @@ def test_nothing():
[int(MAX_EARLY_DATA / 2), int(MAX_EARLY_DATA - 1), MAX_EARLY_DATA, 1],
)
def test_s2n_server_with_early_data(
managed_process,
managed_process, # noqa: F811
tmp_path,
cipher,
curve,
Expand Down Expand Up @@ -233,7 +233,7 @@ def test_s2n_server_with_early_data(
[int(MAX_EARLY_DATA / 2), int(MAX_EARLY_DATA - 1), MAX_EARLY_DATA, 1],
)
def test_s2n_client_with_early_data(
managed_process,
managed_process, # noqa: F811
tmp_path,
cipher,
certificate,
Expand Down Expand Up @@ -297,7 +297,13 @@ def test_s2n_client_with_early_data(
@pytest.mark.parametrize("provider", SERVER_PROVIDERS, ids=get_parameter_name)
@pytest.mark.parametrize("other_provider", [S2N], ids=get_parameter_name)
def test_s2n_client_without_early_data(
managed_process, tmp_path, cipher, certificate, protocol, provider, other_provider
managed_process,
tmp_path,
cipher,
certificate,
protocol,
provider,
other_provider, # noqa: F811
):
early_data_file = str(tmp_path / EARLY_DATA_FILE)
early_data = get_early_data_bytes(early_data_file, MAX_EARLY_DATA)
Expand Down Expand Up @@ -363,7 +369,7 @@ def test_s2n_client_without_early_data(
[int(MAX_EARLY_DATA / 2), int(MAX_EARLY_DATA - 1), MAX_EARLY_DATA, 1],
)
def test_s2n_server_with_early_data_rejected(
managed_process,
managed_process, # noqa: F811
tmp_path,
cipher,
curve,
Expand Down Expand Up @@ -434,7 +440,7 @@ def test_s2n_server_with_early_data_rejected(
[int(MAX_EARLY_DATA / 2), int(MAX_EARLY_DATA - 1), MAX_EARLY_DATA, 1],
)
def test_s2n_client_with_early_data_rejected_via_hrr(
managed_process,
managed_process, # noqa: F811
tmp_path,
cipher,
curve,
Expand Down Expand Up @@ -511,7 +517,7 @@ def test_s2n_client_with_early_data_rejected_via_hrr(
[int(MAX_EARLY_DATA / 2), int(MAX_EARLY_DATA - 1), MAX_EARLY_DATA, 1],
)
def test_s2n_server_with_early_data_rejected_via_hrr(
managed_process,
managed_process, # noqa: F811
tmp_path,
cipher,
curve,
Expand Down Expand Up @@ -576,7 +582,7 @@ def test_s2n_server_with_early_data_rejected_via_hrr(
@pytest.mark.parametrize("other_provider", [S2N], ids=get_parameter_name)
@pytest.mark.parametrize("excess_early_data", [1, 10, MAX_EARLY_DATA])
def test_s2n_server_with_early_data_max_exceeded(
managed_process,
managed_process, # noqa: F811
tmp_path,
cipher,
curve,
Expand Down
20 changes: 13 additions & 7 deletions tests/integrationv2/test_external_psk.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
ALL_TEST_CERTS,
)
from common import ProviderOptions, Protocols, data_bytes
from fixtures import managed_process # lgtm [py/unused-import]
from fixtures import managed_process # lgtm [py/unused-import] # noqa: F401
from providers import S2N, OpenSSL
from utils import invalid_test_parameters, get_parameter_name, to_bytes
from enum import Enum, auto
Expand Down Expand Up @@ -145,7 +145,7 @@ def test_nothing():
@pytest.mark.parametrize("psk_identity", PSK_IDENTITY_LIST, ids=get_parameter_name)
@pytest.mark.parametrize("psk_secret", PSK_SECRET_LIST, ids=get_parameter_name)
def test_s2n_server_psk_connection(
managed_process,
managed_process, # noqa: F811
cipher,
curve,
protocol,
Expand Down Expand Up @@ -206,7 +206,7 @@ def test_s2n_server_psk_connection(
@pytest.mark.parametrize("psk_identity", PSK_IDENTITY_LIST, ids=get_parameter_name)
@pytest.mark.parametrize("psk_secret", PSK_SECRET_LIST, ids=get_parameter_name)
def test_s2n_server_multiple_psks(
managed_process,
managed_process, # noqa: F811
cipher,
curve,
protocol,
Expand Down Expand Up @@ -294,7 +294,7 @@ def test_s2n_server_multiple_psks(
"certificate", ALL_TEST_CERTS_WITH_EMPTY_CERT, ids=get_parameter_name
)
def test_s2n_server_full_handshake(
managed_process,
managed_process, # noqa: F811
cipher,
curve,
protocol,
Expand Down Expand Up @@ -366,7 +366,7 @@ def test_s2n_server_full_handshake(
@pytest.mark.parametrize("psk_identity", PSK_IDENTITY_LIST, ids=get_parameter_name)
@pytest.mark.parametrize("psk_secret", PSK_SECRET_LIST, ids=get_parameter_name)
def test_s2n_client_psk_connection(
managed_process,
managed_process, # noqa: F811
cipher,
curve,
protocol,
Expand Down Expand Up @@ -428,7 +428,7 @@ def test_s2n_client_psk_connection(
@pytest.mark.parametrize("psk_identity", PSK_IDENTITY_LIST, ids=get_parameter_name)
@pytest.mark.parametrize("psk_secret", PSK_SECRET_LIST, ids=get_parameter_name)
def test_s2n_client_multiple_psks(
managed_process,
managed_process, # noqa: F811
cipher,
curve,
protocol,
Expand Down Expand Up @@ -509,7 +509,13 @@ def test_s2n_client_multiple_psks(
@pytest.mark.parametrize("psk_identity", PSK_IDENTITY_LIST, ids=get_parameter_name)
@pytest.mark.parametrize("psk_secret", PSK_SECRET_LIST, ids=get_parameter_name)
def test_s2n_client_psk_handshake_failure(
managed_process, cipher, curve, protocol, provider, psk_identity, psk_secret
managed_process,
cipher,
curve,
protocol,
provider,
psk_identity,
psk_secret, # noqa: F811
):
port = next(available_ports)
random_bytes = data_bytes(10)
Expand Down
17 changes: 14 additions & 3 deletions tests/integrationv2/test_fragmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from configuration import available_ports, PROTOCOLS
from common import ProviderOptions, Ciphers, Certificates, data_bytes
from fixtures import managed_process # lgtm [py/unused-import]
from fixtures import managed_process # lgtm [py/unused-import] # noqa: F401
from providers import Provider, S2N, OpenSSL, GnuTLS
from utils import (
invalid_test_parameters,
Expand All @@ -31,7 +31,12 @@
@pytest.mark.parametrize("protocol", PROTOCOLS, ids=get_parameter_name)
@pytest.mark.parametrize("certificate", CERTIFICATES_TO_TEST, ids=get_parameter_name)
def test_s2n_server_low_latency(
managed_process, cipher, provider, other_provider, protocol, certificate
managed_process,
cipher,
provider,
other_provider,
protocol,
certificate, # noqa: F811
):
if provider is OpenSSL and "openssl-1.0.2" in provider.get_version():
pytest.skip(
Expand Down Expand Up @@ -97,7 +102,13 @@ def invalid_test_parameters_frag_len(*args, **kwargs):
"frag_len", [512, 2048, 8192, 12345, 16384], ids=get_parameter_name
)
def test_s2n_server_framented_data(
managed_process, cipher, provider, other_provider, protocol, certificate, frag_len
managed_process,
cipher,
provider,
other_provider,
protocol,
certificate,
frag_len, # noqa: F811
):
if provider is OpenSSL and "openssl-1.0.2" in provider.get_version():
pytest.skip(
Expand Down
16 changes: 13 additions & 3 deletions tests/integrationv2/test_happy_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
PROTOCOLS,
)
from common import ProviderOptions, data_bytes
from fixtures import managed_process # lgtm [py/unused-import]
from fixtures import managed_process # lgtm [py/unused-import] # noqa: F401
from providers import Provider, S2N, OpenSSL, JavaSSL, GnuTLS, SSLv3Provider
from utils import (
invalid_test_parameters,
Expand All @@ -29,7 +29,12 @@
@pytest.mark.parametrize("protocol", PROTOCOLS, ids=get_parameter_name)
@pytest.mark.parametrize("certificate", ALL_TEST_CERTS, ids=get_parameter_name)
def test_s2n_server_happy_path(
managed_process, cipher, provider, curve, protocol, certificate
managed_process,
cipher,
provider,
curve,
protocol,
certificate, # noqa: F811
):
port = next(available_ports)

Expand Down Expand Up @@ -94,7 +99,12 @@ def test_s2n_server_happy_path(
@pytest.mark.parametrize("protocol", PROTOCOLS, ids=get_parameter_name)
@pytest.mark.parametrize("certificate", ALL_TEST_CERTS, ids=get_parameter_name)
def test_s2n_client_happy_path(
managed_process, cipher, provider, curve, protocol, certificate
managed_process,
cipher,
provider,
curve,
protocol,
certificate, # noqa: F811
):
port = next(available_ports)

Expand Down
Loading
Loading