Skip to content

Commit

Permalink
Change: Update formatting with black 24.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoernricks committed Jan 26, 2024
1 parent 64a1d24 commit 73f48bc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
8 changes: 5 additions & 3 deletions autohooks/precommit/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,11 @@ def run() -> int:

term.bold_info("autohooks => pre-commit")

with autohooks_module_path(), term.indent(), Progress(
terminal=term
) as progress:
with (
autohooks_module_path(),
term.indent(),
Progress(terminal=term) as progress,
):
for name in config.get_pre_commit_script_names():
term.info(f"Running {name}")
with term.indent():
Expand Down
9 changes: 6 additions & 3 deletions tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,12 @@ def temp_python_module(
Example:
with temp_python_module("print()", name="bar") as python_module_path
"""
with tempdir(
add_to_sys_path=True,
) as tmp_dir, ensure_unload_module(name):
with (
tempdir(
add_to_sys_path=True,
) as tmp_dir,
ensure_unload_module(name),
):
test_file = tmp_dir / f"{name}.py"
test_file.write_text(content, encoding="utf8")
yield test_file
Expand Down
13 changes: 8 additions & 5 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,14 @@

class ExecGitTestCase(unittest.TestCase):
def test_exec_fail(self):
with tempdir(change_into=True), self.assertRaisesRegex(
GitError,
r"Git command '\['git', 'foo'\]' returned non-zero exit "
"status 1",
) as err:
with (
tempdir(change_into=True),
self.assertRaisesRegex(
GitError,
r"Git command '\['git', 'foo'\]' returned non-zero exit "
"status 1",
) as err,
):
exec_git("foo")

exception = err.exception
Expand Down

0 comments on commit 73f48bc

Please sign in to comment.