Remove some type: ignores fixed in typeshed
This commit is contained in:
parent
1787bffda0
commit
1cc1ac5183
|
@ -78,7 +78,8 @@ class AssertionRewritingHook(importlib.abc.MetaPathFinder):
|
||||||
# there's nothing to rewrite there
|
# there's nothing to rewrite there
|
||||||
# python3.5 - python3.6: `namespace`
|
# python3.5 - python3.6: `namespace`
|
||||||
# python3.7+: `None`
|
# python3.7+: `None`
|
||||||
or spec.origin in {None, "namespace"}
|
or spec.origin == "namespace"
|
||||||
|
or spec.origin is None
|
||||||
# we can only rewrite source files
|
# we can only rewrite source files
|
||||||
or not isinstance(spec.loader, importlib.machinery.SourceFileLoader)
|
or not isinstance(spec.loader, importlib.machinery.SourceFileLoader)
|
||||||
# if the file doesn't exist, we can't rewrite it
|
# if the file doesn't exist, we can't rewrite it
|
||||||
|
@ -743,8 +744,7 @@ class AssertionRewriter(ast.NodeVisitor):
|
||||||
from _pytest.warning_types import PytestAssertRewriteWarning
|
from _pytest.warning_types import PytestAssertRewriteWarning
|
||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
# Ignore type: typeshed bug https://github.com/python/typeshed/pull/3121
|
warnings.warn_explicit(
|
||||||
warnings.warn_explicit( # type: ignore
|
|
||||||
PytestAssertRewriteWarning(
|
PytestAssertRewriteWarning(
|
||||||
"assertion is always true, perhaps remove parentheses?"
|
"assertion is always true, perhaps remove parentheses?"
|
||||||
),
|
),
|
||||||
|
|
|
@ -368,9 +368,7 @@ class DoctestTextfile(pytest.Module):
|
||||||
)
|
)
|
||||||
|
|
||||||
parser = doctest.DocTestParser()
|
parser = doctest.DocTestParser()
|
||||||
# Remove ignore once this reaches mypy:
|
test = parser.get_doctest(text, globs, name, filename, 0)
|
||||||
# https://github.com/python/typeshed/commit/3e4a251b2b6da6bb43137acf5abf81ecfa7ba8ee
|
|
||||||
test = parser.get_doctest(text, globs, name, filename, 0) # type: ignore
|
|
||||||
if test.examples:
|
if test.examples:
|
||||||
yield DoctestItem(test.name, self, runner, test)
|
yield DoctestItem(test.name, self, runner, test)
|
||||||
|
|
||||||
|
|
|
@ -139,8 +139,7 @@ class Node:
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
path, lineno = get_fslocation_from_item(self)
|
path, lineno = get_fslocation_from_item(self)
|
||||||
# Type ignored: https://github.com/python/typeshed/pull/3121
|
warnings.warn_explicit(
|
||||||
warnings.warn_explicit( # type: ignore
|
|
||||||
warning,
|
warning,
|
||||||
category=None,
|
category=None,
|
||||||
filename=str(path),
|
filename=str(path),
|
||||||
|
|
Loading…
Reference in New Issue