import os

from isort.pylama_isort import Linter


class TestLinter:
    instance = Linter()

    def test_allow(self):
        assert not self.instance.allow("test_case.pyc")
        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"))

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

import os

from isort.pylama_isort import Linter


class TestLinter:
    instance = Linter()

    def test_allow(self):
        assert not self.instance.allow("test_case.pyc")
        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"))

        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):
        incorrect = tmpdir.join("incorrect.py")
        incorrect.write("# isort: skip_file\nimport b\nimport a\n")
        assert not self.instance.run(str(incorrect))

Add a test for skip functionality