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.
14 lines
339 B
Python
14 lines
339 B
Python
import sys
|
|
|
|
if __name__ == "__main__":
|
|
import cProfile
|
|
import pytest # NOQA
|
|
import pstats
|
|
|
|
script = sys.argv[1:] if len(sys.argv) > 1 else ["empty.py"]
|
|
cProfile.run("pytest.cmdline.main(%r)" % script, "prof")
|
|
p = pstats.Stats("prof")
|
|
p.strip_dirs()
|
|
p.sort_stats("cumulative")
|
|
print(p.print_stats(500))
|