Skip to content

Commit e735e76

Browse files
committed
chore: Include 'test' dir in style check
1 parent d80aa8c commit e735e76

File tree

4 files changed

+36
-30
lines changed

4 files changed

+36
-30
lines changed

justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ lint-types:
8686

8787
# Lint style conventions.
8888
lint-style:
89-
ruff check {{src-dir}}
89+
ruff check
9090
black -t py312 --check {{src-dir}} {{test-dir}}
9191

9292
# Lint various metrics.

tests/_import_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def test_import_file_ok(tmpdir):
1919
mod = import_file(mod_fp, "volt.test.custom")
2020

2121
assert hasattr(mod, "Test")
22-
cls = getattr(mod, "Test")
22+
cls = mod.Test
2323
inst = cls()
2424
assert inst.val == 1
2525

tests/cli_test.py

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -176,17 +176,19 @@ def test_build_ok_e2e(
176176
runner = u.CommandRunner()
177177
toks = ["build"]
178178

179-
with runner.isolated_filesystem() as ifs:
180-
with isolated_project_dir(ifs, "ok_minimal") as project_dir:
181-
output_dir = project_dir / constants.PROJECT_OUTPUT_DIR_NAME
182-
assert not output_dir.exists()
179+
with (
180+
runner.isolated_filesystem() as ifs,
181+
isolated_project_dir(ifs, "ok_minimal") as project_dir,
182+
):
183+
output_dir = project_dir / constants.PROJECT_OUTPUT_DIR_NAME
184+
assert not output_dir.exists()
183185

184-
res = runner.invoke(cli.root, toks)
185-
assert res.exit_code == 0, res.output
186+
res = runner.invoke(cli.root, toks)
187+
assert res.exit_code == 0, res.output
186188

187-
assert output_dir.exists()
188-
u.assert_dir_contains_only(output_dir, ["assets", "index.html"])
189-
u.assert_dir_contains_only(output_dir / "assets", ["style.css"])
189+
assert output_dir.exists()
190+
u.assert_dir_contains_only(output_dir, ["assets", "index.html"])
191+
u.assert_dir_contains_only(output_dir / "assets", ["style.css"])
190192

191193
return None
192194

@@ -478,18 +480,20 @@ def test_help_with_xcmd(
478480
) -> None:
479481
runner = u.CommandRunner()
480482

481-
with runner.isolated_filesystem() as ifs:
482-
with isolated_project_dir(ifs, "ok_extended") as project_dir:
483-
assert (project_dir / "extension" / "cli.py").exists()
483+
with (
484+
runner.isolated_filesystem() as ifs,
485+
isolated_project_dir(ifs, "ok_extended") as project_dir,
486+
):
487+
assert (project_dir / "extension" / "cli.py").exists()
484488

485-
res0 = runner.invoke(cli.root, [])
486-
assert res0.exit_code == 0, res0.output
487-
assert " xcmd " in res0.output, res0.output
489+
res0 = runner.invoke(cli.root, [])
490+
assert res0.exit_code == 0, res0.output
491+
assert " xcmd " in res0.output, res0.output
488492

489-
res1 = runner.invoke(cli.root, ["xcmd"])
490-
assert res1.exit_code == 0, res1.output
491-
assert " hello-ext " in res1.output, res1.output
493+
res1 = runner.invoke(cli.root, ["xcmd"])
494+
assert res1.exit_code == 0, res1.output
495+
assert " hello-ext " in res1.output, res1.output
492496

493-
res2 = runner.invoke(cli.root, ["xcmd", "hello-ext"])
494-
assert res2.exit_code == 0, res2.output
495-
assert "FooBar!" in res2.output, res2.output
497+
res2 = runner.invoke(cli.root, ["xcmd", "hello-ext"])
498+
assert res2.exit_code == 0, res2.output
499+
assert "FooBar!" in res2.output, res2.output

tests/utils.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,15 @@ def serve() -> None:
138138
runner = CommandRunner()
139139
toks = args or ["serve", "-h", host, "-p", f"{port}", "--no-sig-handlers"]
140140

141-
with runner.isolated_filesystem() as ifs:
142-
with isolation_func(ifs, project_fixture_name) as pd:
143-
project_dir = pd
144-
sentinel_file = pd / sentinel_project_file
145-
assert not sentinel_file.exists()
146-
147-
runner.invoke(cli.root, toks)
141+
with (
142+
runner.isolated_filesystem() as ifs,
143+
isolation_func(ifs, project_fixture_name) as pd,
144+
):
145+
project_dir = pd
146+
sentinel_file = pd / sentinel_project_file
147+
assert not sentinel_file.exists()
148+
149+
runner.invoke(cli.root, toks)
148150

149151
def start() -> None:
150152
nonlocal sentinel_file

0 commit comments

Comments
 (0)