build: TestSetup doesn't take keyword arguments

This function is currently setup with keyword arguments defaulting to
None. However, it is never called without passing all of it's arguments
explicitly, and only one of it's arguments would actually be valid as
None. So just drop that, and make them all positional. And annotate
them.
pull/5395/head
Dylan Baker 6 years ago
parent 285db6637d
commit 502a684872
  1. 4
      mesonbuild/build.py
  2. 5
      mesonbuild/interpreter.py

@ -19,6 +19,7 @@ import itertools, pathlib
import hashlib
import pickle
from functools import lru_cache
import typing
from . import environment
from . import dependencies
@ -2359,7 +2360,8 @@ class RunScript(dict):
self['args'] = args
class TestSetup:
def __init__(self, *, exe_wrapper=None, gdb=None, timeout_multiplier=None, env=None):
def __init__(self, exe_wrapper: typing.Optional[typing.List[str]], gdb: bool,
timeout_multiplier: int, env: EnvironmentVariables):
self.exe_wrapper = exe_wrapper
self.gdb = gdb
self.timeout_multiplier = timeout_multiplier

@ -3765,10 +3765,7 @@ different subdirectory.
'is_default can be set to true only once' % self.build.test_setup_default_name)
self.build.test_setup_default_name = setup_name
env = self.unpack_env_kwarg(kwargs)
self.build.test_setups[setup_name] = build.TestSetup(exe_wrapper=exe_wrapper,
gdb=gdb,
timeout_multiplier=timeout_multiplier,
env=env)
self.build.test_setups[setup_name] = build.TestSetup(exe_wrapper, gdb, timeout_multiplier, env)
def get_argdict_on_crossness(self, native_dict, cross_dict, kwargs):
for_native = kwargs.get('native', not self.environment.is_cross_build())

Loading…
Cancel
Save