Skip to content

Commit 747caba

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 3378a16 commit 747caba

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ dependencies = [
5151
"iniconfig",
5252
"packaging",
5353
"pluggy>=1.5,<2",
54-
"tomli>=1; python_version<'3.11'",
5554
"pygments>=2.7.2",
55+
"tomli>=1; python_version<'3.11'",
5656
]
5757
optional-dependencies.dev = [
5858
"argcomplete",

src/_pytest/_io/terminalwriter.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
from typing import TextIO
1212

1313
import pygments
14+
from pygments.formatters.terminal import TerminalFormatter
1415
from pygments.lexer import Lexer
15-
from pygments.lexers.python import PythonLexer
1616
from pygments.lexers.diff import DiffLexer
17-
from pygments.formatters.terminal import TerminalFormatter
17+
from pygments.lexers.python import PythonLexer
1818

1919
from ..compat import assert_never
2020
from .wcwidth import wcswidth
@@ -238,7 +238,9 @@ def _highlight(
238238
pygments_lexer = self._get_pygments_lexer(lexer)
239239
pygments_formatter = self._get_pygments_formatter()
240240

241-
highlighted: str = pygments.highlight(source, pygments_lexer, pygments_formatter)
241+
highlighted: str = pygments.highlight(
242+
source, pygments_lexer, pygments_formatter
243+
)
242244
# pygments terminal formatter may add a newline when there wasn't one.
243245
# We don't want this, remove.
244246
if highlighted[-1] == "\n" and source[-1] != "\n":

0 commit comments

Comments
 (0)