Skip to content

Commit 405fd15

Browse files
nicoddemuspytestbot
authored andcommitted
[7.2.x] Fix tests pygments 2.14.0
1 parent c16315f commit 405fd15

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

testing/conftest.py

+1
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ class ColorMapping:
157157
"number": "\x1b[94m",
158158
"str": "\x1b[33m",
159159
"print": "\x1b[96m",
160+
"endline": "\x1b[90m\x1b[39;49;00m",
160161
}
161162
RE_COLORS = {k: re.escape(v) for k, v in COLORS.items()}
162163

testing/io/test_terminalwriter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def test_combining(self) -> None:
254254
pytest.param(
255255
True,
256256
True,
257-
"{kw}assert{hl-reset} {number}0{hl-reset}\n",
257+
"{kw}assert{hl-reset} {number}0{hl-reset}{endline}\n",
258258
id="with markup and code_highlight",
259259
),
260260
pytest.param(

testing/test_terminal.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -1265,14 +1265,14 @@ def test_this():
12651265
"=*= FAILURES =*=",
12661266
"{red}{bold}_*_ test_this _*_{reset}",
12671267
"",
1268-
" {kw}def{hl-reset} {function}test_this{hl-reset}():",
1269-
"> fail()",
1268+
" {kw}def{hl-reset} {function}test_this{hl-reset}():{endline}",
1269+
"> fail(){endline}",
12701270
"",
12711271
"{bold}{red}test_color_yes.py{reset}:5: ",
12721272
"_ _ * _ _*",
12731273
"",
1274-
" {kw}def{hl-reset} {function}fail{hl-reset}():",
1275-
"> {kw}assert{hl-reset} {number}0{hl-reset}",
1274+
" {kw}def{hl-reset} {function}fail{hl-reset}():{endline}",
1275+
"> {kw}assert{hl-reset} {number}0{hl-reset}{endline}",
12761276
"{bold}{red}E assert 0{reset}",
12771277
"",
12781278
"{bold}{red}test_color_yes.py{reset}:2: AssertionError",
@@ -1292,9 +1292,9 @@ def test_this():
12921292
"=*= FAILURES =*=",
12931293
"{red}{bold}_*_ test_this _*_{reset}",
12941294
"{bold}{red}test_color_yes.py{reset}:5: in test_this",
1295-
" fail()",
1295+
" fail(){endline}",
12961296
"{bold}{red}test_color_yes.py{reset}:2: in fail",
1297-
" {kw}assert{hl-reset} {number}0{hl-reset}",
1297+
" {kw}assert{hl-reset} {number}0{hl-reset}{endline}",
12981298
"{bold}{red}E assert 0{reset}",
12991299
"{red}=*= {red}{bold}1 failed{reset}{red} in *s{reset}{red} =*={reset}",
13001300
]
@@ -2472,8 +2472,8 @@ def test_foo():
24722472
result.stdout.fnmatch_lines(
24732473
color_mapping.format_for_fnmatch(
24742474
[
2475-
" {kw}def{hl-reset} {function}test_foo{hl-reset}():",
2476-
"> {kw}assert{hl-reset} {number}1{hl-reset} == {number}10{hl-reset}",
2475+
" {kw}def{hl-reset} {function}test_foo{hl-reset}():{endline}",
2476+
"> {kw}assert{hl-reset} {number}1{hl-reset} == {number}10{hl-reset}{endline}",
24772477
"{bold}{red}E assert 1 == 10{reset}",
24782478
]
24792479
)
@@ -2494,9 +2494,9 @@ def test_foo():
24942494
result.stdout.fnmatch_lines(
24952495
color_mapping.format_for_fnmatch(
24962496
[
2497-
" {kw}def{hl-reset} {function}test_foo{hl-reset}():",
2497+
" {kw}def{hl-reset} {function}test_foo{hl-reset}():{endline}",
24982498
" {print}print{hl-reset}({str}'''{hl-reset}{str}{hl-reset}",
2499-
"> {str} {hl-reset}{str}'''{hl-reset}); {kw}assert{hl-reset} {number}0{hl-reset}",
2499+
"> {str} {hl-reset}{str}'''{hl-reset}); {kw}assert{hl-reset} {number}0{hl-reset}{endline}",
25002500
"{bold}{red}E assert 0{reset}",
25012501
]
25022502
)
@@ -2517,8 +2517,8 @@ def test_foo():
25172517
result.stdout.fnmatch_lines(
25182518
color_mapping.format_for_fnmatch(
25192519
[
2520-
" {kw}def{hl-reset} {function}test_foo{hl-reset}():",
2521-
"> {kw}assert{hl-reset} {number}1{hl-reset} == {number}10{hl-reset}",
2520+
" {kw}def{hl-reset} {function}test_foo{hl-reset}():{endline}",
2521+
"> {kw}assert{hl-reset} {number}1{hl-reset} == {number}10{hl-reset}{endline}",
25222522
"{bold}{red}E assert 1 == 10{reset}",
25232523
]
25242524
)

0 commit comments

Comments
 (0)