Skip to content

Commit

Permalink
test(project-root): improve testing message
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee-W committed Nov 12, 2024
1 parent e67e99d commit 4fcb3a3
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions tests/test_bake_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pytest


def run_cmd(cmd: str) -> tuple[bytes, bytes, int]:
def run_cmd(cmd: str) -> tuple[str, str, int]:
process = subprocess.Popen(
cmd,
shell=True,
Expand All @@ -15,7 +15,7 @@ def run_cmd(cmd: str) -> tuple[bytes, bytes, int]:
)
stdout, stderr = process.communicate()
return_code = process.returncode
return stdout, stderr, return_code
return stdout.decode("utf-8"), stderr.decode("utf-8"), return_code


@pytest.fixture
Expand Down Expand Up @@ -99,16 +99,22 @@ def test_project_setup(

monkeypatch.chdir(result.project_path)

_, __, exit_code = run_cmd(f"{dependency_management_tool} run inv env.init-dev")
stdout, stderr, exit_code = run_cmd(f"{dependency_management_tool} run inv env.init-dev")
print(stdout)
print(stderr)
assert exit_code == 0

_, __, exit_code = run_cmd(f"{dependency_management_tool} run inv style")
stdout, stderr, exit_code = run_cmd(f"{dependency_management_tool} run inv style")
print(stdout)
print(stderr)
assert exit_code == 0

run_cmd("git add .")
_, __, exit_code = run_cmd(
stdout, stderr, exit_code = run_cmd(
f"SKIP=no-commit-to-branch {dependency_management_tool} run pre-commit run --all-files"
)
print(stdout)
print(stderr)
assert exit_code == 0

run_cmd("rm -rf .venv")

0 comments on commit 4fcb3a3

Please sign in to comment.