diff options
author | Timothy Crosley <timothy.crosley@gmail.com> | 2019-05-12 16:56:03 -0700 |
---|---|---|
committer | Timothy Crosley <timothy.crosley@gmail.com> | 2019-05-12 16:56:03 -0700 |
commit | 36102e5498c06058e8f8c31205f63b5e2f9ec978 (patch) | |
tree | 1db9d7747a470f69680813404c8a57678276bb29 | |
parent | 7c72ba21dfc651096beb23b570e5e50180f05e35 (diff) | |
download | isort-issue/942.tar.gz |
Ensure pyi test will work accross OSes by using splitlines to handle newline character differencesissue/942
-rw-r--r-- | test_isort.py | 13 |
1 files 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 |