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.
```
timeit result for 10000 iterations of expanding '/d' (lowered the count in the code afterwards)
# 2.7.5 3.3.2
# FilesCompleter 75.1109 69.2116
# FastFilesCompleter 0.7383 1.0760
```
- does not display prefix dir (like bash, not like compgen), py.test /usr/<TAB> does not show /usr/bin/ but bin/