diff options
author | Daniel Hahler <git@thequod.de> | 2019-03-01 12:27:30 +0100 |
---|---|---|
committer | Daniel Hahler <git@thequod.de> | 2019-03-01 12:27:30 +0100 |
commit | 919cb73e836a855d594aa5a023ba3417779b28d3 (patch) | |
tree | 034bbb5ecc9de7f0d5b0c7df27d882d47ca00456 | |
parent | f0badf18389935b0275660f8f3ef9899dc4c4f49 (diff) | |
download | isort-919cb73e836a855d594aa5a023ba3417779b28d3.tar.gz |
tests: fix default_settings_path
Restore `chdir` after tests.
This is relevant for when pytest-cov would display coverage in the end,
and would use absolute paths due to this.
-rw-r--r-- | test_isort.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test_isort.py b/test_isort.py index b35d6cdd..ce1d6927 100644 --- a/test_isort.py +++ b/test_isort.py @@ -68,8 +68,9 @@ def default_settings_path(tmpdir_factory): config_file = config_dir.join('.editorconfig').strpath with open(config_file, 'w') as editorconfig: editorconfig.write(TEST_DEFAULT_CONFIG) - os.chdir(config_dir.strpath) - return config_dir.strpath + + with config_dir.as_cwd(): + yield config_dir.strpath def test_happy_path(): |