From ed2dfbe2e0b10a8595d0161dbb2190f0f702c0ab Mon Sep 17 00:00:00 2001 From: Nigel Babu Date: Tue, 20 Dec 2016 12:52:25 +0530 Subject: Raise custom exceptions rather assert failures The setup should never raise an assert failure in a test. Only tests should fail an assert. If an essential test setup doesn't work, we should be raising custom exceptions instead. Change-Id: I6d5cce448132b71b6fde3a39fef894be8b1216d3 Signed-off-by: Nigel Babu --- tests/functional/bvt/test_bvt_lite_and_plus.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/functional/bvt') diff --git a/tests/functional/bvt/test_bvt_lite_and_plus.py b/tests/functional/bvt/test_bvt_lite_and_plus.py index 55db725b9..074d57910 100644 --- a/tests/functional/bvt/test_bvt_lite_and_plus.py +++ b/tests/functional/bvt/test_bvt_lite_and_plus.py @@ -45,7 +45,8 @@ class BvtTestsClass(GlusterVolumeBaseClass): "scripts/file_dir_ops.py") cls.script_upload_path = "/tmp/file_dir_ops.py" ret = os.path.exists(cls.script_local_path) - assert (ret is True), ("Unable to find the io scripts") + if not ret: + raise Exception("Unable to find the io scripts") for client in cls.clients: g.upload(client, cls.script_local_path, cls.script_upload_path) -- cgit