From: Kyr Shatskyy Date: Fri, 27 Sep 2019 22:19:18 +0000 (+0200) Subject: Remove BaseException.message deprecation warning X-Git-Tag: 1.1.0~228^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1310%2Fhead;p=teuthology.git Remove BaseException.message deprecation warning DeprecationWarning: BaseException.message has been deprecated as of Python 2.6 Signed-off-by: Kyr Shatskyy --- diff --git a/teuthology/test/test_run.py b/teuthology/test/test_run.py index 7fda10280..eddcf8f08 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}