Skip to content

Commit 9e18ea8

Browse files
committed
test/config(refactor[yaml-fixture]): switch to multiline string
why: Chained string literals are harder to read/update than a single YAML block when crafting duplicate-root fixtures. what: - build the duplicate workspace config with a triple-quoted string via textwrap.dedent for clarity - import textwrap alongside existing logging dependency
1 parent 3b468a6 commit 9e18ea8

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

tests/test_config.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from __future__ import annotations
44

55
import logging
6+
import textwrap
67
import typing as t
78

89
import pytest
@@ -149,13 +150,15 @@ def test_extract_repos_injects_workspace_root(
149150
def _write_duplicate_config(tmp_path: pathlib.Path) -> pathlib.Path:
150151
config_path = tmp_path / "config.yaml"
151152
config_path.write_text(
152-
(
153-
"~/workspace/:\n"
154-
" alpha:\n"
155-
" repo: git+https://example.com/alpha.git\n"
156-
"~/workspace/:\n"
157-
" beta:\n"
158-
" repo: git+https://example.com/beta.git\n"
153+
textwrap.dedent(
154+
"""\
155+
~/workspace/:
156+
alpha:
157+
repo: git+https://example.com/alpha.git
158+
~/workspace/:
159+
beta:
160+
repo: git+https://example.com/beta.git
161+
"""
159162
),
160163
encoding="utf-8",
161164
)

0 commit comments

Comments
 (0)