Skip to content
Merged
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
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
max-line-length = 120
6 changes: 4 additions & 2 deletions test/integration/test_io_raw_ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
9 changes: 0 additions & 9 deletions test/integration/test_io_tcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
8 changes: 1 addition & 7 deletions test/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
__email__ = 'grzegorz.latuszek@nokia.com, marcin.usielski@nokia.com'

import copy
import sys

import mock
import pytest
Expand Down Expand Up @@ -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 <type 'bool'> but 4 is type of <type 'int'>" \
== msg
else:
assert "root -> [3] True is type of <class 'bool'> but 4 is type of <class 'int'>"\
== msg
assert "root -> [3] True is type of <class 'bool'> but 4 is type of <class 'int'>" == msg


def test_diff_different_values():
Expand Down
6 changes: 1 addition & 5 deletions test/test_moler_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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():
Expand Down
Loading