diff options
author | Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> | 2022-04-05 21:21:38 +0200 |
---|---|---|
committer | Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> | 2022-04-05 22:08:56 +0200 |
commit | bc05106a3331a803215e975c014aae6541fe6b23 (patch) | |
tree | 88ce9156bd8a080e8bb444136bffa7c54fcb38dd /tests/unittest_reporting.py | |
parent | 0ea91bd2087cbff96bd35f37eb46736061951857 (diff) | |
download | pylint-git-bc05106a3331a803215e975c014aae6541fe6b23.tar.gz |
Use namespace in PyLinter and tests
Diffstat (limited to 'tests/unittest_reporting.py')
-rw-r--r-- | tests/unittest_reporting.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/unittest_reporting.py b/tests/unittest_reporting.py index 6db3f5a96..2d47f53e1 100644 --- a/tests/unittest_reporting.py +++ b/tests/unittest_reporting.py @@ -36,7 +36,7 @@ def disable(): def test_template_option(linter): output = StringIO() linter.reporter.out = output - linter.set_option("msg-template", "{msg_id}:{line:03d}") + linter.namespace.msg_template = "{msg_id}:{line:03d}" linter.open() linter.set_current_module("0123") linter.add_message("C0301", line=1, args=(1, 2)) @@ -62,9 +62,8 @@ def test_template_option_end_line(linter) -> None: """Test the msg-template option with end_line and end_column.""" output = StringIO() linter.reporter.out = output - linter.set_option( - "msg-template", - "{path}:{line}:{column}:{end_line}:{end_column}: {msg_id}: {msg} ({symbol})", + linter.namespace.msg_template = ( + "{path}:{line}:{column}:{end_line}:{end_column}: {msg_id}: {msg} ({symbol})" ) linter.open() linter.set_current_module("my_mod") @@ -85,9 +84,8 @@ def test_template_option_non_existing(linter) -> None: """ output = StringIO() linter.reporter.out = output - linter.set_option( - "msg-template", - "{path}:{line}:{a_new_option}:({a_second_new_option:03d})", + linter.namespace.msg_template = ( + "{path}:{line}:{a_new_option}:({a_second_new_option:03d})" ) linter.open() with pytest.warns(UserWarning) as records: @@ -136,7 +134,7 @@ def test_parseable_output_regression(): linter = PyLinter(reporter=ParseableTextReporter()) checkers.initialize(linter) - linter.config.persistent = 0 + linter.namespace.persistent = 0 linter.reporter.out = output linter.set_option("output-format", "parseable") linter.open() |