Skip to content

Commit

Permalink
Fixed #1552: Pylama test dependent on source layout.
Browse files Browse the repository at this point in the history
  • Loading branch information
timothycrosley committed Oct 10, 2020
1 parent 9a79067 commit 320124e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Expand Up @@ -7,6 +7,11 @@ Find out more about isort's release policy [here](https://pycqa.github.io/isort/
### 5.6.2 TBD
- Fixed #1548: On rare occasions an unecessary empty line can be added when an import is marked as skipped.
- Fixed #1542: Bug in VERTICAL_PREFIX_FROM_MODULE_IMPORT wrap mode.
- Fixed #1552: Pylama test dependent on source layout.

#### Goal Zero: (Tickets related to aspirational goal of achieving 0 regressions for remaining 5.0.0 lifespan):
- Zope added to integration test suite
- Additional testing of CLI (simulate unseekable streams)

### 5.6.1 [Hotfix] October 8, 2020
- Fixed #1546: Unstable (non-idempotent) behavior with certain src trees.
Expand Down
8 changes: 5 additions & 3 deletions tests/unit/test_pylama_isort.py
Expand Up @@ -11,14 +11,16 @@ def test_allow(self):
assert not self.instance.allow("test_case.c")
assert self.instance.allow("test_case.py")

def test_run(self, src_dir, tmpdir):
assert not self.instance.run(os.path.join(src_dir, "api.py"))
def test_run(self, tmpdir):
correct = tmpdir.join("incorrect.py")
correct.write("import a\nimport b\n")
assert not self.instance.run(str(correct))

incorrect = tmpdir.join("incorrect.py")
incorrect.write("import b\nimport a\n")
assert self.instance.run(str(incorrect))

def test_skip(self, src_dir, tmpdir):
def test_skip(self, tmpdir):
incorrect = tmpdir.join("incorrect.py")
incorrect.write("# isort: skip_file\nimport b\nimport a\n")
assert not self.instance.run(str(incorrect))

0 comments on commit 320124e

Please sign in to comment.