Skip to content

Commit 5ea6fb5

Browse files
Add Codespell integation test for bitbucket
1 parent ac4d08d commit 5ea6fb5

1 file changed

Lines changed: 47 additions & 1 deletion

File tree

tests/usethis/_core/test_ci.py

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@
44

55
from usethis._ci import update_bitbucket_pytest_steps
66
from usethis._core.ci import use_ci_bitbucket
7-
from usethis._core.tool import use_deptry, use_pre_commit, use_pyproject_fmt, use_ruff
7+
from usethis._core.tool import (
8+
use_codespell,
9+
use_deptry,
10+
use_pre_commit,
11+
use_pyproject_fmt,
12+
use_ruff,
13+
)
814
from usethis._integrations.bitbucket.steps import get_steps_in_default
915
from usethis._test import change_cwd
1016

@@ -256,6 +262,46 @@ def test_content(
256262
"☐ Run your pipeline via the Bitbucket website.\n"
257263
)
258264

265+
class TestCodespellIntegration:
266+
def test_content(
267+
self, uv_init_dir: Path, capfd: pytest.CaptureFixture[str]
268+
):
269+
with change_cwd(uv_init_dir):
270+
# Arrange
271+
use_codespell()
272+
capfd.readouterr()
273+
274+
# Act
275+
use_ci_bitbucket()
276+
277+
# Assert
278+
contents = (uv_init_dir / "bitbucket-pipelines.yml").read_text()
279+
assert "codespell" in contents
280+
assert (
281+
contents
282+
== """\
283+
image: atlassian/default-image:3
284+
definitions:
285+
caches:
286+
uv: ~/.cache/uv
287+
script_items:
288+
- &install-uv |
289+
curl -LsSf https://astral.sh/uv/install.sh | sh
290+
source $HOME/.local/bin/env
291+
export UV_LINK_MODE=copy
292+
uv --version
293+
pipelines:
294+
default:
295+
- step:
296+
name: Run Codespell
297+
caches:
298+
- uv
299+
script:
300+
- *install-uv
301+
- uv run codespell
302+
"""
303+
)
304+
259305
def test_lots_of_tools_no_precommit(
260306
self, uv_init_dir: Path, capfd: pytest.CaptureFixture[str]
261307
):

0 commit comments

Comments
 (0)