diff --git a/roles/common/molecule/default/tests/test_default.py b/roles/common/molecule/default/tests/test_default.py index 0b42e155ce2c3d286419b354469df9e8728c7c1e..de8455cf5f380af3ec864e583bc8a6ad3e0611bf 100644 --- a/roles/common/molecule/default/tests/test_default.py +++ b/roles/common/molecule/default/tests/test_default.py @@ -333,7 +333,7 @@ def test_pipreqcheck_virtualenv_packages(host, pip_path, expected_packages): # Normalise package names and order. expected_packages = sorted([unicode(p.lower()) for p in expected_packages]) - actual_packages = sorted(packages.stdout.lower().split("\n")) + actual_packages = sorted(packages.stdout.lower().strip().split("\n")) # This is a dummy distro-provided package ignored by the pip-tools. if "pkg-resources==0.0.0" in actual_packages: @@ -389,7 +389,7 @@ def test_pipreqcheck_virtualenv_python_version(host, python_path, expected_major major_version = host.run("%s -c %s", python_path, "import sys; print(sys.version_info.major)") assert major_version.rc == 0 - assert major_version.stdout == expected_major_version + assert major_version.stdout.strip() == expected_major_version @pytest.mark.parametrize('wrong_python_path', [ diff --git a/roles/common/molecule/default/tests/test_parameters_optional.py b/roles/common/molecule/default/tests/test_parameters_optional.py index f43ae70746d3886604ccc89beaeb91727d5a83cf..2044e34ea6e49625bcc199d30a46132d8bb959ec 100644 --- a/roles/common/molecule/default/tests/test_parameters_optional.py +++ b/roles/common/molecule/default/tests/test_parameters_optional.py @@ -347,7 +347,7 @@ def test_ntp_query_server_count(host): ntpq = host.command("ntpq -p -n") assert ntpq.rc == 0 - assert len(ntpq.stdout.split("\n")) == expected_stdout_line_count + assert len(ntpq.stdout.strip().split("\n")) == expected_stdout_line_count def test_ntp_listening_interfaces(host):