Remove unused type: ignores
Not needed since update from mypy 0.770 -> 0.780.
This commit is contained in:
parent
0f30103d9c
commit
f84ffd9747
|
@ -464,8 +464,7 @@ def pytest_cmdline_main(config: Config) -> Optional[Union[int, ExitCode]]:
|
||||||
|
|
||||||
@pytest.hookimpl(tryfirst=True)
|
@pytest.hookimpl(tryfirst=True)
|
||||||
def pytest_configure(config: Config) -> None:
|
def pytest_configure(config: Config) -> None:
|
||||||
# Type ignored: pending mechanism to store typed objects scoped to config.
|
config.cache = Cache.for_config(config)
|
||||||
config.cache = Cache.for_config(config) # type: ignore # noqa: F821
|
|
||||||
config.pluginmanager.register(LFPlugin(config), "lfplugin")
|
config.pluginmanager.register(LFPlugin(config), "lfplugin")
|
||||||
config.pluginmanager.register(NFPlugin(config), "nfplugin")
|
config.pluginmanager.register(NFPlugin(config), "nfplugin")
|
||||||
|
|
||||||
|
|
|
@ -519,11 +519,10 @@ class MultiCapture:
|
||||||
def pop_outerr_to_orig(self):
|
def pop_outerr_to_orig(self):
|
||||||
""" pop current snapshot out/err capture and flush to orig streams. """
|
""" pop current snapshot out/err capture and flush to orig streams. """
|
||||||
out, err = self.readouterr()
|
out, err = self.readouterr()
|
||||||
# TODO: Fix type ignores.
|
|
||||||
if out:
|
if out:
|
||||||
self.out.writeorg(out) # type: ignore[union-attr] # noqa: F821
|
self.out.writeorg(out)
|
||||||
if err:
|
if err:
|
||||||
self.err.writeorg(err) # type: ignore[union-attr] # noqa: F821
|
self.err.writeorg(err)
|
||||||
return out, err
|
return out, err
|
||||||
|
|
||||||
def suspend_capturing(self, in_: bool = False) -> None:
|
def suspend_capturing(self, in_: bool = False) -> None:
|
||||||
|
@ -543,8 +542,7 @@ class MultiCapture:
|
||||||
if self.err:
|
if self.err:
|
||||||
self.err.resume()
|
self.err.resume()
|
||||||
if self._in_suspended:
|
if self._in_suspended:
|
||||||
# TODO: Fix type ignore.
|
self.in_.resume()
|
||||||
self.in_.resume() # type: ignore[union-attr] # noqa: F821
|
|
||||||
self._in_suspended = False
|
self._in_suspended = False
|
||||||
|
|
||||||
def stop_capturing(self) -> None:
|
def stop_capturing(self) -> None:
|
||||||
|
|
|
@ -988,9 +988,7 @@ class Config:
|
||||||
package_files = (
|
package_files = (
|
||||||
str(file)
|
str(file)
|
||||||
for dist in importlib_metadata.distributions()
|
for dist in importlib_metadata.distributions()
|
||||||
# Type ignored due to missing stub:
|
if any(ep.group == "pytest11" for ep in dist.entry_points)
|
||||||
# https://github.com/python/typeshed/pull/3795
|
|
||||||
if any(ep.group == "pytest11" for ep in dist.entry_points) # type: ignore
|
|
||||||
for file in dist.files or []
|
for file in dist.files or []
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -66,9 +66,7 @@ def get_empty_parameterset_mark(
|
||||||
fs,
|
fs,
|
||||||
lineno,
|
lineno,
|
||||||
)
|
)
|
||||||
# Type ignored because MarkDecorator.__call__() is a bit tough to
|
return mark(reason=reason)
|
||||||
# annotate ATM.
|
|
||||||
return mark(reason=reason) # type: ignore[no-any-return] # noqa: F723
|
|
||||||
|
|
||||||
|
|
||||||
class ParameterSet(
|
class ParameterSet(
|
||||||
|
|
|
@ -1258,7 +1258,7 @@ class TestEarlyRewriteBailout:
|
||||||
|
|
||||||
def spy_find_spec(name, path):
|
def spy_find_spec(name, path):
|
||||||
self.find_spec_calls.append(name)
|
self.find_spec_calls.append(name)
|
||||||
return importlib.machinery.PathFinder.find_spec(name, path) # type: ignore
|
return importlib.machinery.PathFinder.find_spec(name, path)
|
||||||
|
|
||||||
hook = AssertionRewritingHook(pytestconfig)
|
hook = AssertionRewritingHook(pytestconfig)
|
||||||
# use default patterns, otherwise we inherit pytest's testing config
|
# use default patterns, otherwise we inherit pytest's testing config
|
||||||
|
|
Loading…
Reference in New Issue