Add a very lax mypy configuration, add it to tox -e linting, and
fix/ignore the few errors that come up. The idea is to get it running
before diving in too much.
This enables:
- Progressively adding type annotations and enabling more strict
options, which will improve the codebase (IMO).
- Annotating the public API in-line, and eventually exposing it to
library users who use type checkers (with a py.typed file).
Though, none of this is done yet.
Refs https://github.com/pytest-dev/pytest/issues/3342.
Fixes:
> File "…/Vcs/pytest/src/_pytest/config/__init__.py", line 60, in main
> config = _prepareconfig(args, plugins)
> File "…/Vcs/pytest/src/_pytest/config/__init__.py", line 179, in _prepareconfig
> raise TypeError(msg.format(args, type(args)))
> TypeError: `args` parameter expected to be a list or tuple of strings, got: 'empty.py' (type: <class 'str'>)
use the original stream.
- avoid resetting capture FDs/sys.stdout for each test by keeping capturing
always turned on and looking at snapshotted capturing data during runtest
and collection phases.
The only remaining 'py.test' references are:
* those referring to the 'py.test' executable
* those in code explicitly testing py.test/pytest module compatibility
* those in old CHANGES documentation
* those in documentation generated based on external data
* those in seemingly unfinished & unmaintained Japanese documentation
Minor stylistic changes and typo corrections made to documentation next to
several applied py.test --> pytest content changes.