diff options
author | Timothy Crosley <timothy.crosley@gmail.com> | 2019-02-24 02:07:09 -0800 |
---|---|---|
committer | Timothy Crosley <timothy.crosley@gmail.com> | 2019-02-24 02:07:09 -0800 |
commit | c83bad43783e2a52ab9f98a8bf51fe6074bea2d5 (patch) | |
tree | c84f2bc22512b9ea258b253d766f97886b0bb21b | |
parent | e49eaae24bd4a30df3b44ff515d1d1247698a1cb (diff) | |
download | isort-c83bad43783e2a52ab9f98a8bf51fe6074bea2d5.tar.gz |
Make compatible with Python2
-rw-r--r-- | test_isort.py | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/test_isort.py b/test_isort.py index 1908aef1..c4e0edbe 100644 --- a/test_isort.py +++ b/test_isort.py @@ -70,11 +70,11 @@ REALLY_LONG_IMPORT_WITH_COMMENT = ("from third_party import lib1, lib2, lib3, li @pytest.fixture(scope="session", autouse=True) def default_settings_path(tmpdir_factory): config_dir = tmpdir_factory.mktemp('config') - config_file = config_dir.join('.editorconfig') - with open(str(config_file), 'w') as editorconfig: + config_file = config_dir.join('.editorconfig').strpath + with open(config_file, 'w') as editorconfig: editorconfig.write(TEST_DEFAULT_CONFIG) - os.chdir(config_dir) - return str(config_dir) + os.chdir(config_dir.strpath) + return config_dir.strpath def test_happy_path(): @@ -865,21 +865,12 @@ def test_known_pattern_path_expansion(): default_section='THIRDPARTY', known_first_party=['./', 'this', 'kate_plugin'] ).output - if PY2: - assert test_output == ("import os\n" - "import sys\n" - "\n" - "from kate_plugin import isort_plugin\n" - "\n" - "import isort.settings\n" - "import this\n") - else: - assert test_output == ("import os\n" - "import sys\n" - "\n" - "import isort.settings\n" - "import this\n" - "from kate_plugin import isort_plugin\n") + assert test_output == ("import os\n" + "import sys\n" + "\n" + "import isort.settings\n" + "import this\n" + "from kate_plugin import isort_plugin\n") def test_force_single_line_imports(): |