Skip to content

Commit

Permalink
Run pytest after repo checks
Browse files Browse the repository at this point in the history
  • Loading branch information
30350n committed Sep 24, 2023
1 parent d1537ab commit 3c3e12b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions generate_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ def generate_release():
if Repo().is_dirty():
error("repo is dirty (stash changes before generating a release)")

with patch.object(sys, "argv", ["", "-q"]):
info("running pytest ...")
if (exit_code := pytest()) != 0:
error(f"tests failed with {exit_code}")

if Repo().head.is_detached:
error("repo is in detached head state")
if "up to date" not in Repo().git.status():
error("current commit is not pushed")
if Repo().tags[-1].commit != Repo().commit():
error("current commit is not tagged")

with patch.object(sys, "argv", ["", "-q"]):
info("running pytest ...")
if (exit_code := pytest()) != 0:
error(f"tests failed with {exit_code}")

info(f"generating release for {Repo().tags[-1]} ... ")

ARCHIVE_DIRECTORY.mkdir(exist_ok=True)
Expand Down

0 comments on commit 3c3e12b

Please sign in to comment.