Skip to content

Commit

Permalink
fix for old Python versions
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan6419846 committed Feb 26, 2024
1 parent 07ebde0 commit 14c1606
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions tests/scripts/test_make_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@


def test_get_git_commits_since_tag():
with (
open(COMMITS__VERSION_4_0_1, mode="rb") as commits,
mock.patch("urllib.request.urlopen", side_effect=lambda n: commits),
mock.patch("subprocess.check_output", return_value=GIT_LOG__VERSION_4_0_1),
):
with open(COMMITS__VERSION_4_0_1, mode="rb") as commits, \
mock.patch("urllib.request.urlopen", side_effect=lambda n: commits), \
mock.patch("subprocess.check_output", return_value=GIT_LOG__VERSION_4_0_1):
commits = make_release.get_git_commits_since_tag("4.0.1")
assert commits == [
make_release.Change(
Expand Down Expand Up @@ -64,11 +62,9 @@ def test_get_git_commits_since_tag():


def test_get_formatted_changes():
with (
open(COMMITS__VERSION_4_0_1, mode="rb") as commits,
mock.patch("urllib.request.urlopen", side_effect=lambda n: commits),
mock.patch("subprocess.check_output", return_value=GIT_LOG__VERSION_4_0_1),
):
with open(COMMITS__VERSION_4_0_1, mode="rb") as commits, \
mock.patch("urllib.request.urlopen", side_effect=lambda n: commits), \
mock.patch("subprocess.check_output", return_value=GIT_LOG__VERSION_4_0_1):
output, output_with_user = make_release.get_formatted_changes("4.0.1")

assert output == """
Expand Down

0 comments on commit 14c1606

Please sign in to comment.