From fbf10c7d74f2be45ca1b67ddd0ca4ec92de5d41d Mon Sep 17 00:00:00 2001 From: Kyr Shatskyy Date: Sat, 28 Sep 2019 00:19:18 +0200 Subject: [PATCH] Remove BaseException.message deprecation warning DeprecationWarning: BaseException.message has been deprecated as of Python 2.6 Signed-off-by: Kyr Shatskyy --- teuthology/test/test_run.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/teuthology/test/test_run.py b/teuthology/test/test_run.py index 7fda102809..eddcf8f08e 100644 --- a/teuthology/test/test_run.py +++ b/teuthology/test/test_run.py @@ -77,7 +77,7 @@ class TestRun(object): config = {"tasks": [{"kernel": "can't be here"}]} with pytest.raises(AssertionError) as excinfo: run.validate_tasks(config) - assert excinfo.value.message.startswith("kernel installation") + assert excinfo.value.args[0].startswith("kernel installation") def test_validate_task_no_tasks(self): result = run.validate_tasks({}) @@ -91,13 +91,13 @@ class TestRun(object): def test_validate_tasks_is_list(self): with pytest.raises(AssertionError) as excinfo: run.validate_tasks({"tasks": {"foo": "bar"}}) - assert excinfo.value.message.startswith("Expected list") + assert excinfo.value.args[0].startswith("Expected list") def test_get_initial_tasks_invalid(self): with pytest.raises(AssertionError) as excinfo: run.get_initial_tasks(True, {"targets": "can't be here", "roles": "roles" }, "machine_type") - assert excinfo.value.message.startswith("You cannot") + assert excinfo.value.args[0].startswith("You cannot") def test_get_inital_tasks(self): config = {"roles": range(2), "kernel": "the_kernel", "use_existing_cluster": False} -- 2.39.5