Skip to content

Commit ebc78ca

Browse files
committed
[codacy] Use of assert detected in core_ocaf unittest
1 parent caae0ae commit ebc78ca

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/core_ocaf_unittest.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,11 @@ def assert_warns_deprecated():
4444
warnings.simplefilter("always")
4545
yield w
4646
# Verify some things
47-
assert issubclass(w[-1].category, DeprecationWarning)
48-
assert "deprecated" in str(w[-1].message)
47+
if not issubclass(w[-1].category, DeprecationWarning):
48+
raise AssertionError("Wrong exception type")
49+
if not "deprecated" in str(w[-1].message):
50+
raise AssertionError("deprecated string not in message")
51+
4952

5053
class TestOCAF(unittest.TestCase):
5154
def test_create_doc(self):

0 commit comments

Comments
 (0)