Add basic mypy linting

Based on pytest setup, though more lax. Currently only the tests are
annotated so only helpful for them.

Fix #721.
This commit is contained in:
Ran Benita
2021-10-30 12:18:11 +03:00
parent 9ddb274f23
commit 787b8d9c14
5 changed files with 32 additions and 6 deletions

View File

@@ -250,7 +250,7 @@ def is_xdist_controller(request_or_session) -> bool:
is_xdist_master = is_xdist_controller
def get_xdist_worker_id(request_or_session) -> str:
def get_xdist_worker_id(request_or_session):
"""Return the id of the current worker ('gw0', 'gw1', etc) or 'master'
if running on the controller node.

View File

@@ -236,8 +236,8 @@ def setup_config(config, basetemp):
if __name__ == "__channelexec__":
channel = channel # noqa
workerinput, args, option_dict, change_sys_path = channel.receive()
channel = channel # type: ignore[name-defined] # noqa: F821
workerinput, args, option_dict, change_sys_path = channel.receive() # type: ignore[name-defined]
if change_sys_path is None:
importpath = os.getcwd()
@@ -260,7 +260,7 @@ if __name__ == "__channelexec__":
setup_config(config, option_dict.get("basetemp"))
config._parser.prog = os.path.basename(workerinput["mainargv"][0])
config.workerinput = workerinput
config.workeroutput = {}
interactor = WorkerInteractor(config, channel)
config.workerinput = workerinput # type: ignore[attr-defined]
config.workeroutput = {} # type: ignore[attr-defined]
interactor = WorkerInteractor(config, channel) # type: ignore[name-defined]
config.hook.pytest_cmdline_main(config=config)