summaryrefslogtreecommitdiff
path: root/tests/functional-tests/common/utils/expectedFailure.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional-tests/common/utils/expectedFailure.py')
-rw-r--r--tests/functional-tests/common/utils/expectedFailure.py38
1 files changed, 20 insertions, 18 deletions
diff --git a/tests/functional-tests/common/utils/expectedFailure.py b/tests/functional-tests/common/utils/expectedFailure.py
index 1b11ec170..e7f0eb68c 100644
--- a/tests/functional-tests/common/utils/expectedFailure.py
+++ b/tests/functional-tests/common/utils/expectedFailure.py
@@ -1,25 +1,25 @@
#!/usr/bin/python3
-## Code taken and modified from unittest2 framework (case.py)
+# Code taken and modified from unittest2 framework (case.py)
-## Copyright (c) 1999-2003 Steve Purcell
-## Copyright (c) 2003-2010 Python Software Foundation
-## Copyright (c) 2010, Nokia (ivan.frade@nokia.com)
+# Copyright (c) 1999-2003 Steve Purcell
+# Copyright (c) 2003-2010 Python Software Foundation
+# Copyright (c) 2010, Nokia (ivan.frade@nokia.com)
-## This module is free software, and you may redistribute it and/or modify
-## it under the same terms as Python itself, so long as this copyright message
-## and disclaimer are retained in their original form.
+# This module is free software, and you may redistribute it and/or modify
+# it under the same terms as Python itself, so long as this copyright message
+# and disclaimer are retained in their original form.
-## IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
-## SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
-## THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-## DAMAGE.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+# SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
+# THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+# DAMAGE.
-## THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
-## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-## PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS,
-## AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
-## SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+# THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+# PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS,
+# AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
+# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
"""
Write values in tracker and check the actual values are written
@@ -29,11 +29,12 @@ import sys
from functools import wraps
import common.utils.configuration as cfg
+
def expectedFailureJournal():
"""
Decorator to handle tests that are expected to fail when journal is disabled.
"""
- def decorator (func):
+ def decorator(func):
# no wrapping if journal is enabled, test is expected to pass
if not cfg.disableJournal:
return func
@@ -44,6 +45,7 @@ def expectedFailureJournal():
func(*args, **kwargs)
except Exception:
raise ut.case._ExpectedFailure(sys.exc_info())
- raise Exception ("Unexpected success. This should fail because journal is disabled")
+ raise Exception(
+ "Unexpected success. This should fail because journal is disabled")
return wrapper
return decorator