Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ff4d392

Browse files
Lorak-mmkdkropachev
authored andcommitted
execute_count: Use plain assert
1 parent 4a0b793 commit ff4d392

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

‎tests/integration/cqlengine/__init__.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,7 @@ def wrapped_function(*args, **kwargs):
7777
# DeMonkey Patch our code
7878
cassandra.cqlengine.connection.execute = original_function
7979
# Check to see if we have a pre-existing test case to work from.
80-
if args:
81-
test_case = args[0]
82-
else:
83-
test_case = unittest.TestCase("__init__")
84-
# Check to see if the count is what you expect
85-
test_case.assertEqual(count.get_counter(), expected, msg="Expected number of cassandra.cqlengine.connection.execute calls ({0}) doesn't match actual number invoked ({1})".format(expected, count.get_counter()))
80+
assert count.get_counter() == expected, "Expected number of cassandra.cqlengine.connection.execute calls ({0}) doesn't match actual number invoked ({1})".format(expected, count.get_counter())
8681
return to_return
8782
# Name of the wrapped function must match the original or unittest will error out.
8883
wrapped_function.__name__ = fn.__name__
@@ -94,5 +89,3 @@ def wrapped_function(*args, **kwargs):
9489
return wrapped_function
9590

9691
return innerCounter
97-
98-

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /