Skip to content

Remove _ArgumentsManager.namespace #6319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion pylint/checkers/typecheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,12 @@ class TypeChecker(BaseChecker):
(
"ignored-classes",
{
"default": ("optparse.Values", "thread._local", "_thread._local"),
"default": (
"optparse.Values",
"thread._local",
"_thread._local",
"argparse.Namespace",
),
"type": "csv",
"metavar": "<members names>",
"help": "List of class names for which member attributes "
Expand Down
8 changes: 0 additions & 8 deletions pylint/config/arguments_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,6 @@ def config(self) -> argparse.Namespace:
def config(self, value: argparse.Namespace) -> None:
self._config = value

@property
def namespace(self) -> argparse.Namespace:
return self.config

@namespace.setter
def namespace(self, value: argparse.Namespace) -> None:
self.config = value

def _register_options_provider(self, provider: _ArgumentsProvider) -> None:
"""Register an options provider and load its defaults."""
for opt, optdict in provider.options:
Expand Down
12 changes: 0 additions & 12 deletions tests/config/test_argparse_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,6 @@
LOGGING_TEST = join(HERE, "data", "logging_format_interpolation_style.py")


class TestArgumentsManager:
"""Tests for the ArgumentsManager class"""

base_run = Run([EMPTY_MODULE], exit=False)

def test_namespace_creation(self) -> None:
"""Test that the linter object has a namespace attribute and that it is not empty"""

assert self.base_run.linter.config == self.base_run.linter.namespace
assert self.base_run.linter.config._get_kwargs()


class TestArgparseOptionsProviderMixin:
"""Tests for the argparse implementation of OptionsProviderMixIn.

Expand Down