summaryrefslogtreecommitdiff
path: root/test_isort.py
diff options
context:
space:
mode:
authorTimothy Edmund Crosley <timothy.crosley@gmail.com>2019-03-06 00:09:35 -0800
committerTimothy Crosley <timothy.crosley@gmail.com>2019-03-06 00:22:20 -0800
commit91ae94e477d066f133a889d13f3bd25363785258 (patch)
treebc7978a7084e1f34e6366ee6c26037589c2b13e3 /test_isort.py
parenta856e15f8351387b37c2be663b654c6667ff3d78 (diff)
downloadisort-91ae94e477d066f133a889d13f3bd25363785258.tar.gz
Merge in improvement for safe skips
Diffstat (limited to 'test_isort.py')
-rw-r--r--test_isort.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/test_isort.py b/test_isort.py
index f1f6bbe0..999f1a1e 100644
--- a/test_isort.py
+++ b/test_isort.py
@@ -2745,6 +2745,7 @@ def test_safety_excludes(tmpdir, enabled):
tmpdir.join("victim.py").write("# ...")
tmpdir.mkdir(".tox").join("verysafe.py").write("# ...")
tmpdir.mkdir("lib").mkdir("python3.7").join("importantsystemlibrary.py").write("# ...")
+ tmpdir.mkdir(".pants.d").join("pants.py").write("import os")
config = dict(settings.default.copy(), safety_excludes=enabled)
skipped = []
codes = [str(tmpdir)],
@@ -2752,10 +2753,12 @@ def test_safety_excludes(tmpdir, enabled):
file_names = set(os.path.relpath(f, str(tmpdir)) for f in main.iter_source_code([str(tmpdir)], config, skipped))
if enabled:
assert file_names == {'victim.py'}
- assert len(skipped) == 2
+ assert len(skipped) == 3
else:
assert file_names == {os.sep.join(('.tox', 'verysafe.py')),
- os.sep.join(('lib', 'python3.7', 'importantsystemlibrary.py')), 'victim.py'}
+ os.sep.join(('lib', 'python3.7', 'importantsystemlibrary.py')),
+ os.sep.join(('.pants.d', 'pants.py')),
+ 'victim.py'}
assert not skipped