summaryrefslogtreecommitdiff
path: root/tests/config
diff options
context:
space:
mode:
authorDaniël van Noord <13665637+DanielNoord@users.noreply.github.com>2022-05-17 13:52:13 +0200
committerDaniël van Noord <13665637+DanielNoord@users.noreply.github.com>2022-05-21 15:23:24 +0200
commit9d782026d43e48e49f3ddb95bfb511df1f456e16 (patch)
tree46947dc391f4f9d7803226576de042e5a0de370e /tests/config
parenta6a55f079f4f764893fb3a4596f93243653487c3 (diff)
downloadpylint-git-9d782026d43e48e49f3ddb95bfb511df1f456e16.tar.gz
Add invocation test
Diffstat (limited to 'tests/config')
-rw-r--r--tests/config/pylint_config/test_run_pylint_config.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/config/pylint_config/test_run_pylint_config.py b/tests/config/pylint_config/test_run_pylint_config.py
new file mode 100644
index 000000000..17a9509f1
--- /dev/null
+++ b/tests/config/pylint_config/test_run_pylint_config.py
@@ -0,0 +1,24 @@
+# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
+# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt
+
+"""Test for the 'pylint-config generate' command."""
+
+
+import warnings
+
+import pytest
+from pytest import CaptureFixture
+
+from pylint import _run_pylint_config
+
+
+def test_invocation_of_pylint_config(capsys: CaptureFixture[str]) -> None:
+ """Check that the help messages are displayed correctly."""
+ with warnings.catch_warnings():
+ warnings.filterwarnings("ignore", message="NOTE:.*", category=UserWarning)
+ with pytest.raises(SystemExit) as ex:
+ _run_pylint_config()
+ captured = capsys.readouterr()
+ assert captured.err.startswith("usage: pylint-config [options]")
+ assert ex.value.code == 2