Skip to content

Commit 97af26f

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent bf69601 commit 97af26f

File tree

6 files changed

+27
-24
lines changed

6 files changed

+27
-24
lines changed

src/_pytask/capture.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,11 @@ def pytask_post_parse(config: dict[str, Any]) -> None:
136136

137137

138138
def _colorama_workaround() -> None:
139-
"""Ensure colorama is imported so that it attaches to the correct stdio
140-
handles on Windows.
139+
"""Ensure colorama is imported so that it attaches to the correct stdio handles on
140+
Windows.
141141
142-
colorama uses the terminal on import time. So if something does the
143-
first import of colorama while I/O capture is active, colorama will
144-
fail in various ways.
142+
colorama uses the terminal on import time. So if something does the first import of
143+
colorama while I/O capture is active, colorama will fail in various ways.
145144
146145
"""
147146
if sys.platform.startswith("win32"):
@@ -429,8 +428,8 @@ def snap(self) -> bytes:
429428
return res
430429

431430
def done(self) -> None:
432-
"""Stop capturing, restore streams, return original capture file,
433-
seeked to position zero."""
431+
"""Stop capturing, restore streams, return original capture file, seeked to
432+
position zero."""
434433
self._assert_state("done", ("initialized", "started", "suspended", "done"))
435434
if self._state == "done":
436435
return

src/_pytask/hookspecs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,8 @@ def pytask_execute_task(session: Session, task: Task) -> Any:
388388
def pytask_execute_task_teardown(session: Session, task: Task) -> None:
389389
"""Tear down task execution.
390390
391-
This hook is executed after the task has been executed. It allows to perform
392-
clean-up operations or checks for missing products.
391+
This hook is executed after the task has been executed. It allows to perform clean-
392+
up operations or checks for missing products.
393393
394394
"""
395395

src/_pytask/warnings.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,10 @@ def catch_warnings_for_item(
8282
when: str | None = None,
8383
) -> Generator[None, None, None]:
8484
"""Context manager that catches warnings generated in the contained execution block.
85-
``item`` can be None if we are not in the context of an item execution.
86-
Each warning captured triggers the ``pytest_warning_recorded`` hook.
85+
86+
``item`` can be None if we are not in the context of an item execution. Each warning
87+
captured triggers the ``pytest_warning_recorded`` hook.
88+
8789
"""
8890
with warnings.catch_warnings(record=True) as log:
8991
# mypy can't infer that record=True means log is not None; help it.
@@ -181,11 +183,8 @@ def parse_warning_filter(
181183

182184

183185
def _resolve_warning_category(category: str) -> type[Warning]:
184-
"""
185-
Copied from warnings._getcategory, but changed so it lets exceptions (specially
186-
ImportErrors) propagate so we can get access to their tracebacks (#9218).
187-
188-
"""
186+
"""Copied from warnings._getcategory, but changed so it lets exceptions (specially
187+
ImportErrors) propagate so we can get access to their tracebacks (#9218)."""
189188
__tracebackhide__ = True
190189
if not category:
191190
return Warning

tests/test_capture.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,11 @@ def test_unicode_and_str_mixture(self):
273273
pytest.raises(TypeError, f.write, b"hello")
274274

275275
def test_write_bytes_to_buffer(self):
276-
"""In python3, stdout / stderr are text io wrappers (exposing a buffer
277-
property of the underlying bytestream). See issue #1407
276+
"""In python3, stdout / stderr are text io wrappers (exposing a buffer property
277+
of the underlying bytestream).
278+
279+
See issue #1407
280+
278281
"""
279282
f = capture.CaptureIO()
280283
f.buffer.write(b"foo\r\n")

tests/test_debugging.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,8 @@ def task_1():
326326
@pytest.mark.skipif(not IS_PEXPECT_INSTALLED, reason="pexpect is not installed.")
327327
@pytest.mark.skipif(sys.platform == "win32", reason="pexpect cannot spawn on Windows.")
328328
def test_pdb_with_injected_do_debug(tmp_path):
329-
"""Simulates pdbpp, which injects Pdb into do_debug, and uses
330-
self.__class__ in do_continue.
331-
"""
329+
"""Simulates pdbpp, which injects Pdb into do_debug, and uses self.__class__ in
330+
do_continue."""
332331
source = """
333332
import pdb
334333

tests/test_task.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,9 +360,12 @@ def func(produces, content):
360360

361361
@pytest.mark.end_to_end
362362
def test_parametrized_tasks_without_arguments_in_signature(tmp_path, runner):
363-
"""This happens when plugins replace the function with its own implementation. Then,
364-
there is usually no point in adding arguments to the function signature. Or when
365-
people build weird workarounds like the one below."""
363+
"""This happens when plugins replace the function with its own implementation.
364+
365+
Then, there is usually no point in adding arguments to the function signature. Or
366+
when people build weird workarounds like the one below.
367+
368+
"""
366369
source = f"""
367370
import pytask
368371
from pathlib import Path

0 commit comments

Comments
 (0)