-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make
PyLinter
subclass ArgumentsManager
and add tests
- Loading branch information
1 parent
3e0bc0a
commit a1b5e5c
Showing
3 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
"""Test for the (new) implementation of option parsing with argparse""" | ||
|
||
import argparse | ||
|
||
from pylint import config | ||
from pylint.lint import PyLinter | ||
|
||
|
||
class TestArgumentsManager: | ||
"""Tests for the ArgumentsManager class""" | ||
|
||
@staticmethod | ||
def test_initialize_arguments_manager_class(linter: PyLinter) -> None: | ||
"""Tests that ArgumentsManager is correctly initialized on a PyLinter class""" | ||
assert isinstance(linter, config._ArgumentsManager) | ||
assert isinstance(linter.namespace, argparse.Namespace) | ||
|
||
@staticmethod | ||
def test_help_message(linter: PyLinter) -> None: | ||
"""Test the help_message attribute of the ArgumentsManager class""" | ||
assert isinstance(linter.help_message, str) | ||
lines = linter.help_message.splitlines() | ||
assert lines[0] == "usage: pylint [-h]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters