summaryrefslogtreecommitdiff
path: root/tests/extensions
diff options
context:
space:
mode:
authorDaniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>2021-09-16 16:58:37 +0200
committerGitHub <noreply@github.com>2021-09-16 16:58:37 +0200
commit0d246e55a3d13d4fb0829c000064fa26fcbd4183 (patch)
treee63a3ebb6a6370a54073cbab46ff7c1f15a16111 /tests/extensions
parentdc0c7e97b1e92beffa36f76c5c56164f69b81a2a (diff)
downloadpylint-git-0d246e55a3d13d4fb0829c000064fa26fcbd4183.tar.gz
Add typing to ``filepath`` (#4980)
* Change tests for ``filepath`` changes * Add pylint/typing.py and FileItem NamedTuple * Use NamedTuple more efficiently * Fix errors and tests after adding warning * Add deprecation for future API change in Checker Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Diffstat (limited to 'tests/extensions')
-rw-r--r--tests/extensions/test_broad_try_clause.py3
-rw-r--r--tests/extensions/test_comparetozero.py3
2 files changed, 4 insertions, 2 deletions
diff --git a/tests/extensions/test_broad_try_clause.py b/tests/extensions/test_broad_try_clause.py
index 21c79fed0..a41a7ab3d 100644
--- a/tests/extensions/test_broad_try_clause.py
+++ b/tests/extensions/test_broad_try_clause.py
@@ -13,6 +13,7 @@
"""Tests for the pylint checker in :mod:`pylint.extensions.broad_try_clause`"""
import unittest
from os import path as osp
+from typing import Optional
from pylint import checkers
from pylint.extensions.broad_try_clause import BroadTryClauseChecker
@@ -21,7 +22,7 @@ from pylint.reporters import BaseReporter
class BroadTryClauseTestReporter(BaseReporter):
- def on_set_current_module(self, module: str, filepath: str) -> None:
+ def on_set_current_module(self, module: str, filepath: Optional[str]) -> None:
self.messages = []
def _display(self, layout):
diff --git a/tests/extensions/test_comparetozero.py b/tests/extensions/test_comparetozero.py
index 167a615ef..c90c21183 100644
--- a/tests/extensions/test_comparetozero.py
+++ b/tests/extensions/test_comparetozero.py
@@ -14,6 +14,7 @@
import os
import unittest
+from typing import Optional
from pylint import checkers
from pylint.extensions.comparetozero import CompareToZeroChecker
@@ -22,7 +23,7 @@ from pylint.reporters import BaseReporter
class CompareToZeroTestReporter(BaseReporter):
- def on_set_current_module(self, module: str, filepath: str) -> None:
+ def on_set_current_module(self, module: str, filepath: Optional[str]) -> None:
self.messages = []
def _display(self, layout):