From 320124e8a5637fdcd9850eb2d2aa6d5b7e72be33 Mon Sep 17 00:00:00 2001 From: Timothy Crosley Date: Sat, 10 Oct 2020 03:51:18 -0700 Subject: [PATCH] Fixed #1552: Pylama test dependent on source layout. --- CHANGELOG.md | 5 +++++ tests/unit/test_pylama_isort.py | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e774eaad6..661ef3a3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/tests/unit/test_pylama_isort.py b/tests/unit/test_pylama_isort.py index 1fe19bfa1..035b5e31d 100644 --- a/tests/unit/test_pylama_isort.py +++ b/tests/unit/test_pylama_isort.py @@ -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))