Skip to content

Commit 9432633

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent a5c6ed9 commit 9432633

File tree

4 files changed

+20
-24
lines changed

4 files changed

+20
-24
lines changed

chartpress.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
import sys
1414
from collections.abc import MutableMapping
1515
from enum import Enum
16-
from functools import lru_cache
17-
from functools import partial
16+
from functools import lru_cache, partial
1817
from tempfile import TemporaryDirectory
1918

2019
import docker

tests/test_chartpress.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import json
22
import sys
3-
from subprocess import PIPE
4-
from subprocess import run
5-
from urllib.request import Request
6-
from urllib.request import urlopen
3+
from subprocess import PIPE, run
4+
from urllib.request import Request, urlopen
75
from uuid import uuid4
86

97
import pytest
@@ -13,8 +11,7 @@ def test_list_images(git_repo):
1311
p = run(
1412
[sys.executable, "-m", "chartpress", "--list-images"],
1513
check=True,
16-
stdout=PIPE,
17-
stderr=PIPE,
14+
capture_output=True,
1815
)
1916
stdout = p.stdout.decode("utf8").strip()
2017
# echo stdout/stderr for debugging
@@ -30,8 +27,7 @@ def test_list_images(git_repo):
3027
p = run(
3128
["git", "status", "--porcelain"],
3229
check=True,
33-
stdout=PIPE,
34-
stderr=PIPE,
30+
capture_output=True,
3531
)
3632
assert not p.stdout, "--list-images should not make changes!"
3733

@@ -86,8 +82,7 @@ def test_buildx(git_repo):
8682
tag,
8783
],
8884
check=True,
89-
stdout=PIPE,
90-
stderr=PIPE,
85+
capture_output=True,
9186
)
9287
stdout = p.stdout.decode("utf8").strip()
9388
stderr = p.stderr.decode("utf8").strip()

tests/test_helpers.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
import pytest
22
from ruamel.yaml import YAML
33

4-
from chartpress import _check_call
5-
from chartpress import _get_git_remote_url
6-
from chartpress import _get_identifier_from_parts
7-
from chartpress import _get_image_build_args
8-
from chartpress import _get_image_extra_build_command_options
9-
from chartpress import _get_latest_commit_tagged_or_modifying_paths
10-
from chartpress import _image_needs_pushing
11-
from chartpress import Builder
12-
from chartpress import GITHUB_ACTOR_KEY
13-
from chartpress import GITHUB_TOKEN_KEY
4+
from chartpress import (
5+
GITHUB_ACTOR_KEY,
6+
GITHUB_TOKEN_KEY,
7+
Builder,
8+
_check_call,
9+
_get_git_remote_url,
10+
_get_identifier_from_parts,
11+
_get_image_build_args,
12+
_get_image_extra_build_command_options,
13+
_get_latest_commit_tagged_or_modifying_paths,
14+
_image_needs_pushing,
15+
)
1416

1517
# use safe roundtrip yaml loader
1618
yaml = YAML(typ="rt")

tests/test_repo_interactions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def test_chartpress_run(git_repo, capfd):
117117
git_repo.git.checkout("gh-pages")
118118

119119
# verify result of --publish-chart
120-
with open("index.yaml", "r") as f:
120+
with open("index.yaml") as f:
121121
index_yaml = f.read()
122122
print(index_yaml)
123123
assert f"version: 1.2.1" in index_yaml
@@ -180,7 +180,7 @@ def test_chartpress_run(git_repo, capfd):
180180
git_repo.git.checkout("gh-pages")
181181

182182
# verify result of --publish-chart
183-
with open("index.yaml", "r") as f:
183+
with open("index.yaml") as f:
184184
index_yaml = f.read()
185185
print("index_yaml follows:")
186186
print(index_yaml)

0 commit comments

Comments
 (0)