summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2019-03-01 12:27:30 +0100
committerDaniel Hahler <git@thequod.de>2019-03-01 12:27:30 +0100
commit919cb73e836a855d594aa5a023ba3417779b28d3 (patch)
tree034bbb5ecc9de7f0d5b0c7df27d882d47ca00456
parentf0badf18389935b0275660f8f3ef9899dc4c4f49 (diff)
downloadisort-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.py5
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():