File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -235,13 +235,13 @@ def _get_pygments_formatter(self) -> Optional["Formatter"]:
235235
236236 except pygments .util .ClassNotFound as e :
237237 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` ."
240240 ) from e
241241 except pygments .util .OptionError as e :
242242 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'."
245245 ) from e
246246
247247 def _highlight (
Original file line number Diff line number Diff line change @@ -2609,8 +2609,8 @@ def test_foo():
26092609 monkeypatch .setenv ("PYTEST_THEME" , "invalid" )
26102610 result = pytester .runpytest_subprocess ("--color=yes" )
26112611 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` ."
26142614 )
26152615
26162616 def test_code_highlight_invalid_theme_mode (
@@ -2625,8 +2625,8 @@ def test_foo():
26252625 monkeypatch .setenv ("PYTEST_THEME_MODE" , "invalid" )
26262626 result = pytester .runpytest_subprocess ("--color=yes" )
26272627 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'."
26302630 )
26312631
26322632
You can’t perform that action at this time.
0 commit comments