summaryrefslogtreecommitdiff
path: root/tests/checkers/unittest_base.py
diff options
context:
space:
mode:
authorDaniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>2021-12-13 23:17:48 +0100
committerGitHub <noreply@github.com>2021-12-13 23:17:48 +0100
commit71bbbdb29407a2b4525f0bf2da8b0025da5fc4d8 (patch)
treeb76887ba7216a30ee99f812bc33142a510a2e7eb /tests/checkers/unittest_base.py
parent78eed6af303e0e9854e43528d17d2ada96f11c09 (diff)
downloadpylint-git-71bbbdb29407a2b4525f0bf2da8b0025da5fc4d8.tar.gz
Check `node` location attributes in unittests and update tests (#5383)
* Allow checking of `end_col_offset` and `end_lineno` in unittests * Allow checking of `col_offset` in unittests * Allow checking of `lineno` in unittests * Update tests for ``TestVariablesChecker`` * Fix ``TestMultiNamingStyle`` * Update tests for ``TestImportsChecker`` * Add location attributes to messages of ``TestTypeChecker`` * Add location params to ``TestMessage``'s of ``TestDeprecatedChecker`` * Add location params to ``TestMessage``'s of ``TestTypeCheckerOnDecorators`` * Add changelog and ``DeprecationWarning``
Diffstat (limited to 'tests/checkers/unittest_base.py')
-rw-r--r--tests/checkers/unittest_base.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/checkers/unittest_base.py b/tests/checkers/unittest_base.py
index bbe2be2fa..3dddd859b 100644
--- a/tests/checkers/unittest_base.py
+++ b/tests/checkers/unittest_base.py
@@ -64,6 +64,10 @@ class TestMultiNamingStyle(CheckerTestCase):
"the `UP` group in the '(?:(?P<UP>[A-Z]+)|(?P<down>[a-z]+))$' pattern",
),
confidence=HIGH,
+ line=2,
+ col_offset=0,
+ end_line=3,
+ end_col_offset=8,
)
with self.assertAddsMessages(message):
cls = None
@@ -94,6 +98,10 @@ class TestMultiNamingStyle(CheckerTestCase):
"'(?:(?P<UP>[A-Z]+)|(?P<down>[a-z]+))$' pattern",
),
confidence=HIGH,
+ line=2,
+ col_offset=0,
+ end_line=3,
+ end_col_offset=8,
),
MessageTest(
"invalid-name",
@@ -104,6 +112,10 @@ class TestMultiNamingStyle(CheckerTestCase):
"the `down` group in the '(?:(?P<UP>[A-Z]+)|(?P<down>[a-z]+))$' pattern",
),
confidence=HIGH,
+ line=6,
+ col_offset=0,
+ end_line=7,
+ end_col_offset=8,
),
]
with self.assertAddsMessages(*messages):
@@ -139,6 +151,10 @@ class TestMultiNamingStyle(CheckerTestCase):
"the `down` group in the '(?:(?P<UP>[A-Z]+)|(?P<down>[a-z]+))$' pattern",
),
confidence=HIGH,
+ line=6,
+ col_offset=0,
+ end_line=7,
+ end_col_offset=8,
)
with self.assertAddsMessages(message):
func = None
@@ -172,6 +188,10 @@ class TestMultiNamingStyle(CheckerTestCase):
"the `down` group in the '(?:(?P<ignore>FOO)|(?P<UP>[A-Z]+)|(?P<down>[a-z]+))$' pattern",
),
confidence=HIGH,
+ line=8,
+ col_offset=0,
+ end_line=9,
+ end_col_offset=8,
)
with self.assertAddsMessages(message):
func = None