Skip to content

Remove self assert #507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 40 commits into from
Jul 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
2e8d427
test_tablets: Remove CCM_CLUSTER global
Lorak-mmk Jul 7, 2025
e10292a
Replace self.assertEqual with plain assert
Lorak-mmk Jul 8, 2025
e966840
Replace self.assertIsNone with plain assert
Lorak-mmk Jul 8, 2025
a34dfe2
Replace self.assertIn with plain assert
Lorak-mmk Jul 8, 2025
3198417
Replace self.assertIsInstance with plain assert
Lorak-mmk Jul 8, 2025
8e7fae2
Replace self.assertNotEqual with plain assert
Lorak-mmk Jul 8, 2025
ff8cb5c
Replace self.assertTrue with plain assert
Lorak-mmk Jul 8, 2025
de680e2
Replace self.assertNotIn with plain assert
Lorak-mmk Jul 8, 2025
768149b
Replace self.assertFalse with plain assert
Lorak-mmk Jul 8, 2025
aae2fcc
Replace self.assertLessEqual with plain assert
Lorak-mmk Jul 8, 2025
011af02
Replace self.assertGreater with plain assert
Lorak-mmk Jul 8, 2025
5e5b6f9
Replace self.assertGreaterEqual with plain assert
Lorak-mmk Jul 8, 2025
826cf2b
Replace self.assertIsNotNone with plain assert
Lorak-mmk Jul 8, 2025
b86bf39
Replace self.assertHasAttr with plain assert
Lorak-mmk Jul 8, 2025
493d15d
Replace self.assertIs with plain assert
Lorak-mmk Jul 8, 2025
5066f33
Replace self.assertLess with plain assert
Lorak-mmk Jul 8, 2025
bde333b
Replace self.assertIsNot with plain assert
Lorak-mmk Jul 8, 2025
2e065b0
Replace self.assertRegex with new util function
Lorak-mmk Jul 11, 2025
cde1008
Replace collection asserts with util methods
Lorak-mmk Jul 11, 2025
cc18e01
Replace self.assertAlmostEqual with pytest.approx
Lorak-mmk Jul 11, 2025
7a3e725
verify_iterator_data: Use plain assert
Lorak-mmk Jul 11, 2025
8327102
test_types: Use new assertEqual for callbacks
Lorak-mmk Jul 11, 2025
6e61283
assert_startswith_diff: Move to utils
Lorak-mmk Jul 11, 2025
fc6082b
Replace commented out unittest asserts with plain asserts
Lorak-mmk Jul 11, 2025
ecfc813
bytesio_testhelper: Use plain asserts for equality testing
Lorak-mmk Jul 11, 2025
c97f3db
bytesio_testhelper: Remove assert_raises argument
Lorak-mmk Jul 11, 2025
48da238
cython/test_datetime_from_timestamp: Use plain assert
Lorak-mmk Jul 11, 2025
6ce4940
cython/test_types: Use plain asserts
Lorak-mmk Jul 11, 2025
bb9e88f
test_response_future: Use util asserts
Lorak-mmk Jul 11, 2025
381e861
Replace assert_startswith with plain assert
Lorak-mmk Jul 11, 2025
a9cfbc1
Remove unused assertion functions
Lorak-mmk Jul 11, 2025
2fbcb9a
assert_query_count_equals: Use pytest.fail
Lorak-mmk Jul 11, 2025
8bf9742
test_types: Remove unittests asserts
Lorak-mmk Jul 11, 2025
adb7144
tests: Get rid of self.fail calls
Lorak-mmk Jul 11, 2025
23b7bf8
check_lookup: use plain assert
Lorak-mmk Jul 16, 2025
295e365
integration/standard/test_metadata: Plain asserts in FunctionTest
Lorak-mmk Jul 16, 2025
a001669
execute_count: Use plain assert
Lorak-mmk Jul 16, 2025
0f22e0b
Replace unitttest assertRaises with pytest.raises
Lorak-mmk Jul 11, 2025
238e33c
assert_quiescent_pool_state: Use plain asserts
Lorak-mmk Jul 16, 2025
cbe760f
Test ConstantReconnectionPolicy: Fix the copy-paste bug
Lorak-mmk Jul 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions tests/integration/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -937,13 +937,6 @@ def tearDown(self):
self.cluster.shutdown()


def assert_startswith(s, prefix):
if not s.startswith(prefix):
raise AssertionError(
'{} does not start with {}'.format(repr(s), repr(prefix))
)


class TestCluster(object):
__test__ = False

Expand Down
9 changes: 1 addition & 8 deletions tests/integration/cqlengine/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,7 @@ def wrapped_function(*args, **kwargs):
# DeMonkey Patch our code
cassandra.cqlengine.connection.execute = original_function
# Check to see if we have a pre-existing test case to work from.
if args:
test_case = args[0]
else:
test_case = unittest.TestCase("__init__")
# Check to see if the count is what you expect
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()))
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())
return to_return
# Name of the wrapped function must match the original or unittest will error out.
wrapped_function.__name__ = fn.__name__
Expand All @@ -94,5 +89,3 @@ def wrapped_function(*args, **kwargs):
return wrapped_function

return innerCounter


12 changes: 0 additions & 12 deletions tests/integration/cqlengine/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,3 @@ class BaseCassEngTestCase(unittest.TestCase):

def setUp(self):
self.session = get_session()

def assertHasAttr(self, obj, attr):
self.assertTrue(hasattr(obj, attr),
"{0} doesn't have attribute: {1}".format(obj, attr))

def assertNotHasAttr(self, obj, attr):
self.assertFalse(hasattr(obj, attr),
"{0} shouldn't have the attribute: {1}".format(obj, attr))

if sys.version_info > (3, 0):
def assertItemsEqual(self, first, second, msg=None):
return self.assertCountEqual(first, second, msg)
Loading
Loading