Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ewjoachim committed Jul 23, 2023
1 parent 4b023d7 commit a7b816b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion coverage_comment/subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,3 @@ def _git(self, *args: str, env: dict[str, str] | None = None, **kwargs) -> str:

def __getattr__(self, name: str) -> Any:
return functools.partial(self._git, name.replace("_", "-"))
return functools.partial(self._git, name.replace("_", "-"))
9 changes: 4 additions & 5 deletions tests/unit/test_subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@


def test_run__ok():
assert subprocess.run("echo", "yay", path=".").strip() == "yay"
assert subprocess.run("echo", "yay", path=pathlib.Path(".")).strip() == "yay"


def test_run__path():
assert subprocess.run("pwd", path="/").strip() == "/"
assert subprocess.run("pwd", path=pathlib.Path("/")).strip() == "/"


def test_run__kwargs():
assert "A=B" in subprocess.run("env", env={"A": "B"}, path=".")
assert "A=B" in subprocess.run("env", env={"A": "B"}, path=pathlib.Path("."))


def test_run__error():
with pytest.raises(subprocess.SubProcessError):
subprocess.run("false", path=".")
subprocess.run("false", path=pathlib.Path("."))


@pytest.fixture
Expand Down Expand Up @@ -85,4 +85,3 @@ def test_git__error(mocker):

with pytest.raises(subprocess.GitError):
git.add("some_file")
git.add("some_file")

0 comments on commit a7b816b

Please sign in to comment.