mirror of
https://github.com/rust-vmm/rust-vmm-ci.git
synced 2026-08-05 03:08:31 +00:00
test: Format with black
Signed-off-by: Jonathan Woollett-Light <jcawl@amazon.co.uk>
This commit is contained in:
committed by
Jonathan Woollett-Light
parent
285971e8c7
commit
56bfdc97bb
16
test_run.py
16
test_run.py
@@ -21,19 +21,18 @@ class TestsContainer(unittest.TestCase):
|
||||
def make_test_function(command):
|
||||
def test(self):
|
||||
subprocess.run(command, shell=True, check=True)
|
||||
|
||||
return test
|
||||
|
||||
|
||||
def retrieve_test_list(
|
||||
config_file=f"{PARENT_DIR}/.buildkite/test_description.json"
|
||||
):
|
||||
def retrieve_test_list(config_file=f"{PARENT_DIR}/.buildkite/test_description.json"):
|
||||
with open(config_file) as jsonFile:
|
||||
test_list = json.load(jsonFile)
|
||||
jsonFile.close()
|
||||
return test_list
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if __name__ == "__main__":
|
||||
help_text = dedent(
|
||||
"""
|
||||
This script allows running all the tests at once on the local machine.
|
||||
@@ -44,15 +43,14 @@ if __name__ == '__main__':
|
||||
base branch, and these tests may not work as expected.
|
||||
"""
|
||||
)
|
||||
parser = ArgumentParser(description=help_text,
|
||||
formatter_class=RawTextHelpFormatter)
|
||||
parser = ArgumentParser(description=help_text, formatter_class=RawTextHelpFormatter)
|
||||
parser.parse_args()
|
||||
|
||||
test_config = retrieve_test_list()
|
||||
for test in test_config['tests']:
|
||||
command = test['command']
|
||||
for test in test_config["tests"]:
|
||||
command = test["command"]
|
||||
command = command.replace("{target_platform}", platform.machine())
|
||||
test_func = make_test_function(command)
|
||||
setattr(TestsContainer, 'test_{}'.format(test['test_name']), test_func)
|
||||
setattr(TestsContainer, "test_{}".format(test["test_name"]), test_func)
|
||||
|
||||
unittest.main(verbosity=2)
|
||||
|
||||
Reference in New Issue
Block a user