From c5a4ad1cafd1f831d80544338eb15ee890b76f2d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 19 Jan 2026 04:45:32 +0000 Subject: [PATCH 1/3] Update dependency black to v26 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- poetry.lock | 60 +++++++++++++++++++++++++------------------------- pyproject.toml | 2 +- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/poetry.lock b/poetry.lock index 8fe3614b..ea83cd0e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -136,45 +136,45 @@ chardet = ">=3.0.2" [[package]] name = "black" -version = "25.12.0" +version = "26.1.0" description = "The uncompromising code formatter." optional = false python-versions = ">=3.10" files = [ - {file = "black-25.12.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:f85ba1ad15d446756b4ab5f3044731bf68b777f8f9ac9cdabd2425b97cd9c4e8"}, - {file = "black-25.12.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:546eecfe9a3a6b46f9d69d8a642585a6eaf348bcbbc4d87a19635570e02d9f4a"}, - {file = "black-25.12.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:17dcc893da8d73d8f74a596f64b7c98ef5239c2cd2b053c0f25912c4494bf9ea"}, - {file = "black-25.12.0-cp310-cp310-win_amd64.whl", hash = "sha256:09524b0e6af8ba7a3ffabdfc7a9922fb9adef60fed008c7cd2fc01f3048e6e6f"}, - {file = "black-25.12.0-cp310-cp310-win_arm64.whl", hash = "sha256:b162653ed89eb942758efeb29d5e333ca5bb90e5130216f8369857db5955a7da"}, - {file = "black-25.12.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:d0cfa263e85caea2cff57d8f917f9f51adae8e20b610e2b23de35b5b11ce691a"}, - {file = "black-25.12.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1a2f578ae20c19c50a382286ba78bfbeafdf788579b053d8e4980afb079ab9be"}, - {file = "black-25.12.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d3e1b65634b0e471d07ff86ec338819e2ef860689859ef4501ab7ac290431f9b"}, - {file = "black-25.12.0-cp311-cp311-win_amd64.whl", hash = "sha256:a3fa71e3b8dd9f7c6ac4d818345237dfb4175ed3bf37cd5a581dbc4c034f1ec5"}, - {file = "black-25.12.0-cp311-cp311-win_arm64.whl", hash = "sha256:51e267458f7e650afed8445dc7edb3187143003d52a1b710c7321aef22aa9655"}, - {file = "black-25.12.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:31f96b7c98c1ddaeb07dc0f56c652e25bdedaac76d5b68a059d998b57c55594a"}, - {file = "black-25.12.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:05dd459a19e218078a1f98178c13f861fe6a9a5f88fc969ca4d9b49eb1809783"}, - {file = "black-25.12.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c1f68c5eff61f226934be6b5b80296cf6939e5d2f0c2f7d543ea08b204bfaf59"}, - {file = "black-25.12.0-cp312-cp312-win_amd64.whl", hash = "sha256:274f940c147ddab4442d316b27f9e332ca586d39c85ecf59ebdea82cc9ee8892"}, - {file = "black-25.12.0-cp312-cp312-win_arm64.whl", hash = "sha256:169506ba91ef21e2e0591563deda7f00030cb466e747c4b09cb0a9dae5db2f43"}, - {file = "black-25.12.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:a05ddeb656534c3e27a05a29196c962877c83fa5503db89e68857d1161ad08a5"}, - {file = "black-25.12.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:9ec77439ef3e34896995503865a85732c94396edcc739f302c5673a2315e1e7f"}, - {file = "black-25.12.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0e509c858adf63aa61d908061b52e580c40eae0dfa72415fa47ac01b12e29baf"}, - {file = "black-25.12.0-cp313-cp313-win_amd64.whl", hash = "sha256:252678f07f5bac4ff0d0e9b261fbb029fa530cfa206d0a636a34ab445ef8ca9d"}, - {file = "black-25.12.0-cp313-cp313-win_arm64.whl", hash = "sha256:bc5b1c09fe3c931ddd20ee548511c64ebf964ada7e6f0763d443947fd1c603ce"}, - {file = "black-25.12.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:0a0953b134f9335c2434864a643c842c44fba562155c738a2a37a4d61f00cad5"}, - {file = "black-25.12.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:2355bbb6c3b76062870942d8cc450d4f8ac71f9c93c40122762c8784df49543f"}, - {file = "black-25.12.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9678bd991cc793e81d19aeeae57966ee02909877cb65838ccffef24c3ebac08f"}, - {file = "black-25.12.0-cp314-cp314-win_amd64.whl", hash = "sha256:97596189949a8aad13ad12fcbb4ae89330039b96ad6742e6f6b45e75ad5cfd83"}, - {file = "black-25.12.0-cp314-cp314-win_arm64.whl", hash = "sha256:778285d9ea197f34704e3791ea9404cd6d07595745907dd2ce3da7a13627b29b"}, - {file = "black-25.12.0-py3-none-any.whl", hash = "sha256:48ceb36c16dbc84062740049eef990bb2ce07598272e673c17d1a7720c71c828"}, - {file = "black-25.12.0.tar.gz", hash = "sha256:8d3dd9cea14bff7ddc0eb243c811cdb1a011ebb4800a5f0335a01a68654796a7"}, + {file = "black-26.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:ca699710dece84e3ebf6e92ee15f5b8f72870ef984bf944a57a777a48357c168"}, + {file = "black-26.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5e8e75dabb6eb83d064b0db46392b25cabb6e784ea624219736e8985a6b3675d"}, + {file = "black-26.1.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:eb07665d9a907a1a645ee41a0df8a25ffac8ad9c26cdb557b7b88eeeeec934e0"}, + {file = "black-26.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:7ed300200918147c963c87700ccf9966dceaefbbb7277450a8d646fc5646bf24"}, + {file = "black-26.1.0-cp310-cp310-win_arm64.whl", hash = "sha256:c5b7713daea9bf943f79f8c3b46f361cc5229e0e604dcef6a8bb6d1c37d9df89"}, + {file = "black-26.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:3cee1487a9e4c640dc7467aaa543d6c0097c391dc8ac74eb313f2fbf9d7a7cb5"}, + {file = "black-26.1.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d62d14ca31c92adf561ebb2e5f2741bf8dea28aef6deb400d49cca011d186c68"}, + {file = "black-26.1.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:fb1dafbbaa3b1ee8b4550a84425aac8874e5f390200f5502cf3aee4a2acb2f14"}, + {file = "black-26.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:101540cb2a77c680f4f80e628ae98bd2bd8812fb9d72ade4f8995c5ff019e82c"}, + {file = "black-26.1.0-cp311-cp311-win_arm64.whl", hash = "sha256:6f3977a16e347f1b115662be07daa93137259c711e526402aa444d7a88fdc9d4"}, + {file = "black-26.1.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:6eeca41e70b5f5c84f2f913af857cf2ce17410847e1d54642e658e078da6544f"}, + {file = "black-26.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:dd39eef053e58e60204f2cdf059e2442e2eb08f15989eefe259870f89614c8b6"}, + {file = "black-26.1.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9459ad0d6cd483eacad4c6566b0f8e42af5e8b583cee917d90ffaa3778420a0a"}, + {file = "black-26.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:a19915ec61f3a8746e8b10adbac4a577c6ba9851fa4a9e9fbfbcf319887a5791"}, + {file = "black-26.1.0-cp312-cp312-win_arm64.whl", hash = "sha256:643d27fb5facc167c0b1b59d0315f2674a6e950341aed0fc05cf307d22bf4954"}, + {file = "black-26.1.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:ba1d768fbfb6930fc93b0ecc32a43d8861ded16f47a40f14afa9bb04ab93d304"}, + {file = "black-26.1.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:2b807c240b64609cb0e80d2200a35b23c7df82259f80bef1b2c96eb422b4aac9"}, + {file = "black-26.1.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1de0f7d01cc894066a1153b738145b194414cc6eeaad8ef4397ac9abacf40f6b"}, + {file = "black-26.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:91a68ae46bf07868963671e4d05611b179c2313301bd756a89ad4e3b3db2325b"}, + {file = "black-26.1.0-cp313-cp313-win_arm64.whl", hash = "sha256:be5e2fe860b9bd9edbf676d5b60a9282994c03fbbd40fe8f5e75d194f96064ca"}, + {file = "black-26.1.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:9dc8c71656a79ca49b8d3e2ce8103210c9481c57798b48deeb3a8bb02db5f115"}, + {file = "black-26.1.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:b22b3810451abe359a964cc88121d57f7bce482b53a066de0f1584988ca36e79"}, + {file = "black-26.1.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:53c62883b3f999f14e5d30b5a79bd437236658ad45b2f853906c7cbe79de00af"}, + {file = "black-26.1.0-cp314-cp314-win_amd64.whl", hash = "sha256:f016baaadc423dc960cdddf9acae679e71ee02c4c341f78f3179d7e4819c095f"}, + {file = "black-26.1.0-cp314-cp314-win_arm64.whl", hash = "sha256:66912475200b67ef5a0ab665011964bf924745103f51977a78b4fb92a9fc1bf0"}, + {file = "black-26.1.0-py3-none-any.whl", hash = "sha256:1054e8e47ebd686e078c0bb0eaf31e6ce69c966058d122f2c0c950311f9f3ede"}, + {file = "black-26.1.0.tar.gz", hash = "sha256:d294ac3340eef9c9eb5d29288e96dc719ff269a88e27b396340459dd85da4c58"}, ] [package.dependencies] click = ">=8.0.0" mypy-extensions = ">=0.4.3" packaging = ">=22.0" -pathspec = ">=0.9.0" +pathspec = ">=1.0.0" platformdirs = ">=2" pytokens = ">=0.3.0" tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} @@ -3175,4 +3175,4 @@ dev = ["doc8", "flake8", "flake8-import-order", "rstcheck[sphinx]", "ruff", "sph [metadata] lock-version = "2.0" python-versions = ">=3.10, <3.13" -content-hash = "471f70d7ddded4436c73671551e04838b06951fde715aeb0140efdaf762dbd89" +content-hash = "e2bb645c6473423dab2c4585f20446b8e750736f3675f349100abc276a72ad63" diff --git a/pyproject.toml b/pyproject.toml index b7e95a9a..38ed5189 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,7 +51,7 @@ pytest = "9.0.2" pytest-xdist = "3.8.0" pytest-benchmark = "5.2.3" responses = "0.25.8" -black = "25.12.0" +black = "26.1.0" pyfakefs = "6.0.0" pytest-cov = "7.0.0" pylint = "4.0.4" From d10776124f5f527f34699a9affae588d8a5fa1a2 Mon Sep 17 00:00:00 2001 From: Simon Gerber Date: Mon, 19 Jan 2026 10:13:03 +0100 Subject: [PATCH 2/3] Update black to v26 in tox environment --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 41c4897e..91b3e3d8 100644 --- a/tox.ini +++ b/tox.ini @@ -63,7 +63,7 @@ commands = [testenv:black] description = Ensure black formatting is applied deps = - black~=25.1 + black~=26.1 commands = black --check {toxinidir} From 6b3da6905afed628f5320306a4e718db6ec0f1e5 Mon Sep 17 00:00:00 2001 From: Simon Gerber Date: Mon, 19 Jan 2026 10:13:25 +0100 Subject: [PATCH 3/3] Reformat `dedent()`+multiline string for black v26 --- commodore/component/compile.py | 8 ++--- commodore/package/compile.py | 8 ++--- tests/test_catalog.py | 24 +++++--------- tests/test_commodore_libjsonnet.py | 1 - tests/test_component.py | 8 ++--- tests/test_component_compile.py | 14 +++------ tests/test_component_template.py | 6 ++-- tests/test_config.py | 9 ++---- tests/test_helpers.py | 42 +++++++++---------------- tests/test_inventory_lint_components.py | 1 - tests/test_inventory_parameters.py | 1 - tests/test_multi_dependency.py | 1 - tests/test_postprocess.py | 15 +++------ tests/test_target.py | 16 +++------- tests/test_tools.py | 12 +++---- 15 files changed, 48 insertions(+), 118 deletions(-) diff --git a/commodore/component/compile.py b/commodore/component/compile.py index 61825cdc..be5d9dad 100644 --- a/commodore/component/compile.py +++ b/commodore/component/compile.py @@ -267,15 +267,11 @@ def _prepare_kapitan_inventory( # We plug "fake" Argo CD library here because every component relies on it # and we don't want to provide it every time when compiling a single component. with open(inv.lib_dir / "argocd.libjsonnet", "w", encoding="utf-8") as argocd_libf: - argocd_libf.write( - dedent( - """ + argocd_libf.write(dedent(""" local ArgoApp(component, namespace, project='', secrets=true, base=null) = {}; local ArgoProject(name) = {}; { App: ArgoApp, Project: ArgoProject, - }""" - ) - ) + }""")) diff --git a/commodore/package/compile.py b/commodore/package/compile.py index 9908ab76..b1213234 100644 --- a/commodore/package/compile.py +++ b/commodore/package/compile.py @@ -188,15 +188,11 @@ def _setup_inventory( # We plug "fake" Argo CD library here because every component relies on it # and we don't want to provide it every time when compiling a single component. with open(inv.lib_dir / "argocd.libjsonnet", "w", encoding="utf-8") as argocd_libf: - argocd_libf.write( - dedent( - """ + argocd_libf.write(dedent(""" local ArgoApp(component, namespace, project='', secrets=true) = {}; local ArgoProject(name) = {}; { App: ArgoApp, Project: ArgoProject, - }""" - ) - ) + }""")) diff --git a/tests/test_catalog.py b/tests/test_catalog.py index 99b270a8..f89230c7 100644 --- a/tests/test_catalog.py +++ b/tests/test_catalog.py @@ -444,18 +444,14 @@ def test_kapitan_029_030_difffunc_suppresses_noise(): def test_ignore_yaml_formatting_difffunc_keep_semantic_whitespace(): - before_text = textwrap.dedent( - """ + before_text = textwrap.dedent(""" a: b: b - """ - ) - after_text = textwrap.dedent( - """ + """) + after_text = textwrap.dedent(""" a: b: b - """ - ) + """) diffs, suppressed = catalog._ignore_yaml_formatting_difffunc( before_text, after_text, fromfile="test", tofile="test" @@ -477,22 +473,18 @@ def test_ignore_yaml_formatting_difffunc_keep_semantic_whitespace(): def test_ignore_yaml_formatting_difffunc_suppresses_noise(): - before_text = textwrap.dedent( - """ + before_text = textwrap.dedent(""" a: - a - b b: b - """ - ) - after_text = textwrap.dedent( - """ + """) + after_text = textwrap.dedent(""" a: - a - b b: b - """ - ) + """) diffs, suppressed = catalog._ignore_yaml_formatting_difffunc( before_text, after_text, fromfile="test", tofile="test" diff --git a/tests/test_commodore_libjsonnet.py b/tests/test_commodore_libjsonnet.py index ec76cd7b..64a20766 100644 --- a/tests/test_commodore_libjsonnet.py +++ b/tests/test_commodore_libjsonnet.py @@ -12,7 +12,6 @@ import pytest import yaml - TESTS_DIR = Path(__file__).parent / "jsonnet" diff --git a/tests/test_component.py b/tests/test_component.py index ef3b2841..952fa863 100644 --- a/tests/test_component.py +++ b/tests/test_component.py @@ -271,9 +271,7 @@ def _setup_render_jsonnetfile_json(tmp_path: P) -> Component: ur = cr.clone(upath) jsonnetfile = upath / "jsonnetfile.jsonnet" with open(jsonnetfile, "w") as jf: - jf.write( - dedent( - """ + jf.write(dedent(""" { version: 1, dependencies: [ @@ -288,9 +286,7 @@ def _setup_render_jsonnetfile_json(tmp_path: P) -> Component: }, ], legacyImports: true, - }""" - ) - ) + }""")) ur.index.add("*") ur.index.commit("initial commit") ur.remote().push() diff --git a/tests/test_component_compile.py b/tests/test_component_compile.py index cf157a86..1ce854b3 100644 --- a/tests/test_component_compile.py +++ b/tests/test_component_compile.py @@ -42,9 +42,7 @@ def _prepare_component( shutil.move(str(component_root / ".git"), str(tmp_path / component_name)) with open(component_root / "component/main.jsonnet", "a") as file: - file.write( - dedent( - """ + file.write(dedent(""" { "test_service_account": kube.ServiceAccount('test') { metadata+: { @@ -60,9 +58,7 @@ def _prepare_component( }, }, }, - }""" - ) - ) + }""")) return component_root @@ -343,8 +339,7 @@ def test_component_compile_kustomize(tmp_path: P, cli_runner: RunnerFunc): with open( component_path / "component" / "kustomization.jsonnet", "w", encoding="utf-8" ) as f: - f.write( - """ + f.write(""" local com = import 'lib/commodore.libjsonnet'; com.Kustomization( @@ -359,8 +354,7 @@ def test_component_compile_kustomize(tmp_path: P, cli_runner: RunnerFunc): { namespace: 'foo', } -)""" - ) +)""") with open( component_path / "class" / f"{component_name}.yml", "r", encoding="utf-8" ) as cyaml: diff --git a/tests/test_component_template.py b/tests/test_component_template.py index 574b5555..c99ff37b 100644 --- a/tests/test_component_template.py +++ b/tests/test_component_template.py @@ -1729,14 +1729,12 @@ def test_component_update_raises_on_merge_conflict( with open( component_path / "lib" / "test-component.libsonnet", "w", encoding="utf-8" ) as f: - f.write( - """// Test contents + f.write("""// Test contents { Foo: {bar: 1, baz: false}, } -""" - ) +""") r = Repo(component_path) r.index.add([".cruft.json", "lib/test-component.libsonnet"]) diff --git a/tests/test_config.py b/tests/test_config.py index 66d08d63..21e39465 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -327,16 +327,11 @@ def test_print_deprecation_notices(config, capsys): config.print_deprecation_notices() captured = capsys.readouterr() - assert ( - textwrap.dedent( - """ + assert textwrap.dedent(""" Commodore notices: > test 1 > test 2 - """ - ) - == captured.out - ) + """) == captured.out def mock_get_token(url: str) -> Optional[str]: diff --git a/tests/test_helpers.py b/tests/test_helpers.py index 28bd4632..5aec244b 100644 --- a/tests/test_helpers.py +++ b/tests/test_helpers.py @@ -62,44 +62,36 @@ def _test_yaml_dump_fun( [ ( {"a": 1, "b": "test"}, - textwrap.dedent( - """ + textwrap.dedent(""" a: 1 b: test - """ - )[1:], + """)[1:], ), ( {"a": [1, 2], "b": "test"}, - textwrap.dedent( - """ + textwrap.dedent(""" a: - 1 - 2 b: test - """ - )[1:], + """)[1:], ), ( {"a": {"test": 1}, "b": "test"}, - textwrap.dedent( - """ + textwrap.dedent(""" a: test: 1 b: test - """ - )[1:], + """)[1:], ), ( {"a": "first line\nsecond line", "b": "test"}, - textwrap.dedent( - """ + textwrap.dedent(""" a: |- first line second line b: test - """ - )[1:], + """)[1:], ), ], ) @@ -112,38 +104,32 @@ def test_yaml_dump(tmp_path: Path, input, expected): [ ( [{"a": 1}, {"b": "test"}], - textwrap.dedent( - """ + textwrap.dedent(""" a: 1 --- b: test - """ - )[1:], + """)[1:], ), ( [{"a": {"test": "first line\nsecond line"}}, {"b": "test"}], - textwrap.dedent( - """ + textwrap.dedent(""" a: test: |- first line second line --- b: test - """ - )[1:], + """)[1:], ), ( [{"a": [1, 2]}, {"b": "test"}], - textwrap.dedent( - """ + textwrap.dedent(""" a: - 1 - 2 --- b: test - """ - )[1:], + """)[1:], ), ], ) diff --git a/tests/test_inventory_lint_components.py b/tests/test_inventory_lint_components.py index 936cad87..467e63e9 100644 --- a/tests/test_inventory_lint_components.py +++ b/tests/test_inventory_lint_components.py @@ -12,7 +12,6 @@ from commodore.inventory import lint_dependency_specification from commodore.inventory import lint - LINT_FILECONTENTS = [ ({}, 0), ({"a": "b"}, 0), diff --git a/tests/test_inventory_parameters.py b/tests/test_inventory_parameters.py index 3b33569b..82b53c6f 100644 --- a/tests/test_inventory_parameters.py +++ b/tests/test_inventory_parameters.py @@ -9,7 +9,6 @@ from commodore.inventory import parameters from commodore.helpers import yaml_dump - GLOBAL_PARAMS = { "components": { "tc1": { diff --git a/tests/test_multi_dependency.py b/tests/test_multi_dependency.py index 3e491247..da83048e 100644 --- a/tests/test_multi_dependency.py +++ b/tests/test_multi_dependency.py @@ -11,7 +11,6 @@ from test_gitrepo import setup_remote - CASES = [ ( "https://github.com/projectsyn/component-argocd.git", diff --git a/tests/test_postprocess.py b/tests/test_postprocess.py index 60bca56c..f7212877 100644 --- a/tests/test_postprocess.py +++ b/tests/test_postprocess.py @@ -48,8 +48,7 @@ def _make_jsonnet_filter(tmp_path, ns, enabled=None, create_namespace=False): create_ns_jsonnet = "" if create_namespace: - create_ns_jsonnet = dedent( - """ + create_ns_jsonnet = dedent(""" { "00_namespace": { apiVersion: "v1", @@ -63,13 +62,10 @@ def _make_jsonnet_filter(tmp_path, ns, enabled=None, create_namespace=False): } } } - """ - ) + """) with open(filter_file, "w") as ff: - ff.write( - dedent( - """ + ff.write(dedent(""" local com = import 'lib/commodore.libjsonnet'; local inv = com.inventory(); local params = inv.parameters.test_component; @@ -82,10 +78,7 @@ def _make_jsonnet_filter(tmp_path, ns, enabled=None, create_namespace=False): { [stem(file)]: fixup(objs), } - """ - + create_ns_jsonnet - ) - ) + """ + create_ns_jsonnet)) f = { "filters": [ diff --git a/tests/test_target.py b/tests/test_target.py index 54fc9023..589f9a40 100644 --- a/tests/test_target.py +++ b/tests/test_target.py @@ -252,15 +252,11 @@ def test_read_cluster_and_tenant(tmp_path): file = cfg.inventory.params_file os.makedirs(file.parent, exist_ok=True) with open(file, "w") as f: - f.write( - dedent( - """ + f.write(dedent(""" parameters: cluster: name: c-twilight-water-9032 - tenant: t-delicate-pine-3938""" - ) - ) + tenant: t-delicate-pine-3938""")) cluster_id, tenant_id = cluster.read_cluster_and_tenant(cfg.inventory) assert cluster_id == "c-twilight-water-9032" @@ -272,13 +268,9 @@ def test_read_cluster_and_tenant_missing_fact(tmp_path): file = inv.params_file os.makedirs(file.parent, exist_ok=True) with open(file, "w") as f: - f.write( - dedent( - """ + f.write(dedent(""" classes: [] - parameters: {}""" - ) - ) + parameters: {}""")) with pytest.raises(KeyError): cluster.read_cluster_and_tenant(inv) diff --git a/tests/test_tools.py b/tests/test_tools.py index 862f00d6..ea2551f0 100644 --- a/tests/test_tools.py +++ b/tests/test_tools.py @@ -400,14 +400,12 @@ def test_install_helm(config: Config, capfd, tmp_path, github_token): responses.add( responses.GET, "https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-4", - body=textwrap.dedent( - """#!/bin/sh + body=textwrap.dedent("""#!/bin/sh echo 'Helm installer' echo "command line=$@" echo "HELM_INSTALL_DIR=${HELM_INSTALL_DIR}" echo "GITHUB_TOKEN=${GITHUB_TOKEN}" - """ - ), + """), status=200, ) @@ -436,14 +434,12 @@ def test_install_kustomize(config: Config, capfd, tmp_path, github_token): responses.add( responses.GET, "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh", - body=textwrap.dedent( - """#!/bin/sh + body=textwrap.dedent("""#!/bin/sh echo 'Kustomize installer' echo "command line=$@" echo "HELM_INSTALL_DIR=${HELM_INSTALL_DIR}" echo "GITHUB_TOKEN=${GITHUB_TOKEN}" - """ - ), + """), status=200, )