Skip to content

Commit

Permalink
Test for non-worktree run_linter() (unsupported)
Browse files Browse the repository at this point in the history
  • Loading branch information
akaihola committed Oct 17, 2020
1 parent 71952aa commit 451b153
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/darker/tests/test_linting.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,15 @@ def test_run_linter(git_repo, monkeypatch, capsys, _descr, paths, location, expe
# The test cases also verify that only linter reports on modified lines are output.
result = capsys.readouterr().out.splitlines()
assert result == [line.format(git_repo=git_repo) for line in expect]


def test_run_linter_non_worktree():
"""``run_linter()`` doesn't support linting commits, only the worktree"""
with pytest.raises(NotImplementedError):

run_linter(
"dummy-linter",
Path("/dummy"),
{Path("dummy.py")},
RevisionRange.parse("..HEAD"),
)

0 comments on commit 451b153

Please sign in to comment.