mirror of
https://fuchsia.googlesource.com/third_party/github.com/pylint-dev/pylint
synced 2024-09-21 07:58:04 +00:00
Fix test decorator for PyLinter
options (#5195)
This commit is contained in:
parent
259f7a381d
commit
772b3dcc0b
|
@ -24,11 +24,24 @@ def set_config(**kwargs):
|
|||
except optparse.OptionError:
|
||||
# Check if option is one of the base options of the PyLinter class
|
||||
for key, value in kwargs.items():
|
||||
self.checker.set_option(
|
||||
key.replace("_", "-"),
|
||||
value,
|
||||
optdict=dict(PyLinter.make_options()),
|
||||
)
|
||||
try:
|
||||
self.checker.set_option(
|
||||
key.replace("_", "-"),
|
||||
value,
|
||||
optdict=dict(PyLinter.make_options())[
|
||||
key.replace("_", "-")
|
||||
],
|
||||
)
|
||||
except KeyError:
|
||||
# pylint: disable-next=fixme
|
||||
# TODO: Find good way to double load checkers in unittests
|
||||
# When options are used by multiple checkers we need to load both of them
|
||||
# to be able to get an optdict
|
||||
self.checker.set_option(
|
||||
key.replace("_", "-"),
|
||||
value,
|
||||
optdict={},
|
||||
)
|
||||
if isinstance(self, CheckerTestCase):
|
||||
# reopen checker in case, it may be interested in configuration change
|
||||
self.checker.open()
|
||||
|
|
0
tests/testutils/dummy_checker.py
Normal file
0
tests/testutils/dummy_checker.py
Normal file
Loading…
Reference in New Issue
Block a user