From 36102e5498c06058e8f8c31205f63b5e2f9ec978 Mon Sep 17 00:00:00 2001 From: Timothy Crosley Date: Sun, 12 May 2019 16:56:03 -0700 Subject: Ensure pyi test will work accross OSes by using splitlines to handle newline character differences --- test_isort.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/test_isort.py b/test_isort.py index 23de02de..911a5b5e 100644 --- a/test_isort.py +++ b/test_isort.py @@ -3001,17 +3001,18 @@ def test_pyi_formatting_issue_942(tmpdir): '\n' '\n' 'def my_method():\n') - expected_py_output = test_input + expected_py_output = test_input.splitlines() expected_pyi_output = ('import os\n' '\n' - 'def my_method():\n') - assert SortImports(file_contents=test_input).output == expected_py_output - assert SortImports(file_contents=test_input, extension="pyi").output == expected_pyi_output + 'def my_method():\n').splitlines() + assert SortImports(file_contents=test_input).output.splitlines() == expected_py_output + assert SortImports(file_contents=test_input, + extension="pyi").output.splitlines() == expected_pyi_output source_py = tmpdir.join('source.py') source_py.write(test_input) - assert SortImports(file_path=str(source_py)).output == expected_py_output + assert SortImports(file_path=str(source_py)).output.splitlines() == expected_py_output source_pyi = tmpdir.join('source.pyi') source_pyi.write(test_input) - assert SortImports(file_path=str(source_pyi)).output == expected_pyi_output + assert SortImports(file_path=str(source_pyi)).output.splitlines() == expected_pyi_output -- cgit v1.2.1