From f4b1a970326e0f38fa186f21bec3777445c6e9d5 Mon Sep 17 00:00:00 2001 From: Marcin Usielski Date: Thu, 26 Mar 2026 13:17:35 +0100 Subject: [PATCH 1/2] Removed code for Python below 3.8 --- test/integration/test_io_raw_ssh.py | 6 ++++-- test/integration/test_io_tcp.py | 9 --------- test/test_helpers.py | 8 +------- test/test_moler_test.py | 6 +----- 4 files changed, 6 insertions(+), 23 deletions(-) diff --git a/test/integration/test_io_raw_ssh.py b/test/integration/test_io_raw_ssh.py index d0d2a07cb..c14f36dee 100644 --- a/test/integration/test_io_raw_ssh.py +++ b/test/integration/test_io_raw_ssh.py @@ -16,11 +16,13 @@ import pytest import mock import threading -import sys import platform -pytestmark = pytest.mark.skipif(sys.version_info < (3, 4) or 'Linux' != platform.system(), reason="requires python3.4 or higher and skip for no Linux system.") +pytestmark = pytest.mark.skipif( + "Linux" != platform.system(), + reason="Linux-only SSH PTY integration tests.", +) def test_can_create_passive_sshshell_connection_using_same_api(passive_sshshell_connection_class): diff --git a/test/integration/test_io_tcp.py b/test/integration/test_io_tcp.py index b19caaae6..21e9aa642 100644 --- a/test/integration/test_io_tcp.py +++ b/test/integration/test_io_tcp.py @@ -15,14 +15,8 @@ import importlib import pytest import threading -import sys -python3_only = pytest.mark.skipif(sys.version_info < (3, 0), - reason="Not stable under Python2 which is no more supported.") - - -@python3_only() def test_can_open_and_close_connection(tcp_connection_class, integration_tcp_server_and_pipe): """ @@ -43,7 +37,6 @@ def test_can_open_and_close_connection(tcp_connection_class, assert 'Client disconnected' in dialog_with_server -@python3_only() def test_can_open_and_close_connection_as_context_manager(tcp_connection_class, integration_tcp_server_and_pipe): from moler.threaded_moler_connection import ThreadedMolerConnection @@ -62,7 +55,6 @@ def test_can_open_and_close_connection_as_context_manager(tcp_connection_class, # Note: different external-IO connection may have different naming for their 'send' method # however, they are uniformed via glueing with moler_connection.send() # external-IO 'send' method works on bytes; moler_connection performs encoding -@python3_only() def test_can_send_binary_data_over_connection(tcp_connection_class, integration_tcp_server_and_pipe): from moler.threaded_moler_connection import ThreadedMolerConnection @@ -82,7 +74,6 @@ def test_can_send_binary_data_over_connection(tcp_connection_class, # however, they are uniformed via glueing with moler_connection.data_received() # so, external-IO forwards data to moler_connection.data_received() # and moler-connection forwards it to anyone subscribed -@python3_only() def test_can_receive_binary_data_from_connection(tcp_connection_class, integration_tcp_server_and_pipe): from moler.threaded_moler_connection import ThreadedMolerConnection diff --git a/test/test_helpers.py b/test/test_helpers.py index f9f01de1b..3e3b78641 100644 --- a/test/test_helpers.py +++ b/test/test_helpers.py @@ -8,7 +8,6 @@ __email__ = 'grzegorz.latuszek@nokia.com, marcin.usielski@nokia.com' import copy -import sys import mock import pytest @@ -378,12 +377,7 @@ def test_diff_different_types(): b = copy.deepcopy(a) b[3] = 4 msg = diff_data(first_object=a, second_object=b) - if sys.version_info < (3, 0): - assert "root -> [3] True is type of but 4 is type of " \ - == msg - else: - assert "root -> [3] True is type of but 4 is type of "\ - == msg + assert "root -> [3] True is type of but 4 is type of " == msg def test_diff_different_values(): diff --git a/test/test_moler_test.py b/test/test_moler_test.py index f14b19cac..46f5cc3d2 100644 --- a/test/test_moler_test.py +++ b/test/test_moler_test.py @@ -4,7 +4,6 @@ __copyright__ = 'Copyright (C) 2018-2023, Nokia' __email__ = 'michal.ernst@nokia.com, marcin.usielski@nokia.com' -import sys import pytest from moler.connection_observer import ConnectionObserver @@ -13,10 +12,7 @@ def __check_connection_observer_exception(err): - if sys.version_info >= (3, 0): - assert "some error inside observer" in str(err) - else: - assert "There were unhandled exceptions from test caught by Moler" in str(err) + assert "some error inside observer" in str(err) def test_moler_test_warn(): From 52456ec1105cdfcaa951a93e47aca420f826ed7d Mon Sep 17 00:00:00 2001 From: Marcin Usielski Date: Thu, 26 Mar 2026 13:34:03 +0100 Subject: [PATCH 2/2] .falek8 --- .flake8 | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .flake8 diff --git a/.flake8 b/.flake8 new file mode 100644 index 000000000..6deafc261 --- /dev/null +++ b/.flake8 @@ -0,0 +1,2 @@ +[flake8] +max-line-length = 120