| 1 |
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
| 2 |
# For details: https://github.com/pylint-dev/pylint/blob/main/LICENSE |
| 3 |
# Copyright (c) https://github.com/pylint-dev/pylint/blob/main/CONTRIBUTORS.txt |
| 4 |
|
| 5 |
"""Test for the 'pylint-config generate' command.""" |
| 6 |
|
| 7 |
|
| 8 |
import warnings |
| 9 |
|
| 10 |
import pytest |
| 11 |
from pytest import CaptureFixture |
| 12 |
|
| 13 |
from pylint import _run_pylint_config |
| 14 |
|
| 15 |
|
| 16 |
def test_invocation_of_pylint_config(capsys: CaptureFixture[str]) -> None: |
| 17 |
"""Check that the help messages are displayed correctly.""" |
| 18 |
with warnings.catch_warnings(): |
| 19 |
warnings.filterwarnings("ignore", message="NOTE:.*", category=UserWarning) |
| 20 |
with pytest.raises(SystemExit) as ex: |
| 21 |
_run_pylint_config([""]) |
| 22 |
captured = capsys.readouterr() |
| 23 |
assert captured.err.startswith("usage: pylint-config [options]") |
| 24 |
assert ex.value.code == 2 |