File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -235,13 +235,13 @@ def _get_pygments_formatter(self) -> Optional["Formatter"]:
235
235
236
236
except pygments .util .ClassNotFound as e :
237
237
raise UsageError (
238
- f"PYTEST_THEME environment variable had an invalid value: '{ theme } '. "
239
- "Only valid pygment styles are allowed ."
238
+ f"PYTEST_THEME environment variable has an invalid value: '{ theme } '. "
239
+ "Hint: See available pygments styles with `pygmentize -L styles` ."
240
240
) from e
241
241
except pygments .util .OptionError as e :
242
242
raise UsageError (
243
- f"PYTEST_THEME_MODE environment variable had an invalid value: '{ theme_mode } '. "
244
- "The only allowed values are 'dark' and 'light'."
243
+ f"PYTEST_THEME_MODE environment variable has an invalid value: '{ theme_mode } '. "
244
+ "The allowed values are 'dark' (default) and 'light'."
245
245
) from e
246
246
247
247
def _highlight (
Original file line number Diff line number Diff line change @@ -2609,8 +2609,8 @@ def test_foo():
2609
2609
monkeypatch .setenv ("PYTEST_THEME" , "invalid" )
2610
2610
result = pytester .runpytest_subprocess ("--color=yes" )
2611
2611
result .stderr .fnmatch_lines (
2612
- "ERROR: PYTEST_THEME environment variable had an invalid value: 'invalid'. "
2613
- "Only valid pygment styles are allowed ."
2612
+ "ERROR: PYTEST_THEME environment variable has an invalid value: 'invalid'. "
2613
+ "Hint: See available pygments styles with `pygmentize -L styles` ."
2614
2614
)
2615
2615
2616
2616
def test_code_highlight_invalid_theme_mode (
@@ -2625,8 +2625,8 @@ def test_foo():
2625
2625
monkeypatch .setenv ("PYTEST_THEME_MODE" , "invalid" )
2626
2626
result = pytester .runpytest_subprocess ("--color=yes" )
2627
2627
result .stderr .fnmatch_lines (
2628
- "ERROR: PYTEST_THEME_MODE environment variable had an invalid value: 'invalid'. "
2629
- "The only allowed values are 'dark' and 'light'."
2628
+ "ERROR: PYTEST_THEME_MODE environment variable has an invalid value: 'invalid'. "
2629
+ "The allowed values are 'dark' (default) and 'light'."
2630
2630
)
2631
2631
2632
2632
You can’t perform that action at this time.
0 commit comments