diff options
author | Timothy Crosley <timothy.crosley@gmail.com> | 2019-11-07 22:50:01 -0800 |
---|---|---|
committer | Timothy Crosley <timothy.crosley@gmail.com> | 2019-11-07 22:50:01 -0800 |
commit | 12fc36b666b2d8d353252546b442458cd282c299 (patch) | |
tree | 358d86addc5334bc83b674055279b90ba6087125 | |
parent | 2040dd63708b18062033498948b351e160f8b509 (diff) | |
download | isort-feature/refactor-config.tar.gz |
Fix safety skips to match new behaviourfeature/refactor-config
-rw-r--r-- | tests/test_isort.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_isort.py b/tests/test_isort.py index 3b055f23..ce65ba8f 100644 --- a/tests/test_isort.py +++ b/tests/test_isort.py @@ -3179,9 +3179,9 @@ def test_safety_skips(tmpdir, enabled: bool) -> None: tmpdir.mkdir("_build").mkdir("python3.7").join("importantsystemlibrary.py").write("# ...") tmpdir.mkdir(".pants.d").join("pants.py").write("import os") if enabled: - config = Config() + config = Config(directory=str(tmpdir)) else: - config = Config(skip=[]) + config = Config(skip=[], directory=str(tmpdir)) skipped = [] # type: List[str] codes = [str(tmpdir)] main.iter_source_code(codes, config, skipped) @@ -3197,7 +3197,7 @@ def test_safety_skips(tmpdir, enabled: bool) -> None: else: assert file_names == { os.sep.join((".tox", "verysafe.py")), - os.sep.join(("lib", "python3.7", "importantsystemlibrary.py")), + os.sep.join(("_build", "python3.7", "importantsystemlibrary.py")), os.sep.join((".pants.d", "pants.py")), "victim.py", } @@ -3206,7 +3206,7 @@ def test_safety_skips(tmpdir, enabled: bool) -> None: # directly pointing to files within unsafe directories shouldn't skip them either way file_names = { os.path.relpath(f, str(toxdir)) - for f in main.iter_source_code([str(toxdir)], config, skipped) + for f in main.iter_source_code([str(toxdir)], Config(directory=str(toxdir)), skipped) } assert file_names == {"verysafe.py"} |