Skip to content

Commit 2c00eeb

Browse files
committed
tests/integration: Rename some skip/xfail decorators
Renamed some decorators (those that I previously added) from lowercase to lowercase with underscores (as advised by PEP 8 for functions - which a decorator is). I changed newly added decorators, didn't yet touch older ones - still need to decide wheter to do it.
1 parent 392057e commit 2c00eeb

File tree

5 files changed

+21
-21
lines changed

5 files changed

+21
-21
lines changed

tests/integration/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,8 @@ def _id_and_mark(f):
366366
lessthandse51 = unittest.skipUnless(DSE_VERSION and DSE_VERSION < Version('5.1'), "DSE version less than 5.1 required")
367367
lessthandse60 = unittest.skipUnless(DSE_VERSION and DSE_VERSION < Version('6.0'), "DSE version less than 6.0 required")
368368

369-
requirescollectionindexes = unittest.skipUnless(SCYLLA_VERSION is None or Version(SCYLLA_VERSION.split(':')[1]) >= Version('5.2'), 'Test requires Scylla >= 5.2 or Cassandra')
370-
requirescustomindexes = unittest.skipUnless(SCYLLA_VERSION is None, 'Currently, Scylla does not support SASI or any other CUSTOM INDEX class.')
369+
requires_collection_indexes = unittest.skipUnless(SCYLLA_VERSION is None or Version(SCYLLA_VERSION.split(':')[1]) >= Version('5.2'), 'Test requires Scylla >= 5.2 or Cassandra')
370+
requires_custom_indexes = unittest.skipUnless(SCYLLA_VERSION is None, 'Currently, Scylla does not support SASI or any other CUSTOM INDEX class.')
371371

372372
pypy = unittest.skipUnless(platform.python_implementation() == "PyPy", "Test is skipped unless it's on PyPy")
373373
notpy3 = unittest.skipIf(sys.version_info >= (3, 0), "Test not applicable for Python 3.x runtime")

tests/integration/cqlengine/management/test_management.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from cassandra.cqlengine.models import Model
2525
from cassandra.cqlengine import columns
2626

27-
from tests.integration import DSE_VERSION, PROTOCOL_VERSION, greaterthancass20, requirescollectionindexes, MockLoggingHandler, CASSANDRA_VERSION
27+
from tests.integration import DSE_VERSION, PROTOCOL_VERSION, greaterthancass20, requires_collection_indexes, MockLoggingHandler, CASSANDRA_VERSION
2828
from tests.integration.cqlengine.base import BaseCassEngTestCase
2929
from tests.integration.cqlengine.query.test_queryset import TestModel
3030
from cassandra.cqlengine.usertype import UserType
@@ -427,7 +427,7 @@ def test_sync_index_case_sensitive(self):
427427
self.assertIsNotNone(management._get_index_name_by_column(table_meta, 'second_key'))
428428

429429
@greaterthancass20
430-
@requirescollectionindexes
430+
@requires_collection_indexes
431431
def test_sync_indexed_set(self):
432432
"""
433433
Tests that models that have container types with indices can be synced.

tests/integration/cqlengine/query/test_named.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from tests.integration.cqlengine.query.test_queryset import BaseQuerySetUsage
2828

2929

30-
from tests.integration import BasicSharedKeyspaceUnitTestCase, greaterthanorequalcass30, requirescollectionindexes
30+
from tests.integration import BasicSharedKeyspaceUnitTestCase, greaterthanorequalcass30, requires_collection_indexes
3131

3232

3333
class TestQuerySetOperation(BaseCassEngTestCase):
@@ -118,7 +118,7 @@ def test_query_expression_where_clause_generation(self):
118118
self.assertIsInstance(where.operator, GreaterThanOrEqualOperator)
119119
self.assertEqual(where.value, 1)
120120

121-
@requirescollectionindexes
121+
@requires_collection_indexes
122122
class TestQuerySetCountSelectionAndIteration(BaseQuerySetUsage):
123123

124124
@classmethod

tests/integration/cqlengine/query/test_queryset.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
from cassandra.util import uuid_from_time
4040
from cassandra.cqlengine.connection import get_session
4141
from tests.integration import PROTOCOL_VERSION, CASSANDRA_VERSION, greaterthancass20, greaterthancass21, \
42-
greaterthanorequalcass30, TestCluster, requirescollectionindexes
42+
greaterthanorequalcass30, TestCluster, requires_collection_indexes
4343
from tests.integration.cqlengine import execute_count, DEFAULT_KEYSPACE
4444

4545

@@ -384,7 +384,7 @@ def tearDownClass(cls):
384384
drop_table(CustomIndexedTestModel)
385385
drop_table(TestMultiClusteringModel)
386386

387-
@requirescollectionindexes
387+
@requires_collection_indexes
388388
class TestQuerySetCountSelectionAndIteration(BaseQuerySetUsage):
389389

390390
@execute_count(2)
@@ -558,7 +558,7 @@ class NonEqualityFilteringModel(Model):
558558
num = qa.count()
559559
assert num == 1, num
560560

561-
@requirescollectionindexes
561+
@requires_collection_indexes
562562
class TestQuerySetDistinct(BaseQuerySetUsage):
563563

564564
@execute_count(1)
@@ -597,7 +597,7 @@ def test_distinct_with_explicit_count(self):
597597
self.assertEqual(q.count(), 2)
598598

599599

600-
@requirescollectionindexes
600+
@requires_collection_indexes
601601
class TestQuerySetOrdering(BaseQuerySetUsage):
602602
@execute_count(2)
603603
def test_order_by_success_case(self):
@@ -646,7 +646,7 @@ def test_ordering_on_multiple_clustering_columns(self):
646646
assert [r.three for r in results] == [1, 2, 3, 4, 5]
647647

648648

649-
@requirescollectionindexes
649+
@requires_collection_indexes
650650
class TestQuerySetSlicing(BaseQuerySetUsage):
651651

652652
@execute_count(1)
@@ -701,7 +701,7 @@ def test_negative_slicing(self):
701701
self.assertEqual(model.attempt_id, expect)
702702

703703

704-
@requirescollectionindexes
704+
@requires_collection_indexes
705705
class TestQuerySetValidation(BaseQuerySetUsage):
706706

707707
def test_primary_key_or_index_must_be_specified(self):
@@ -783,7 +783,7 @@ def test_custom_indexed_field_can_be_queried(self):
783783
list(CustomIndexedTestModel.objects.filter(test_id=1, description='test'))
784784

785785

786-
@requirescollectionindexes
786+
@requires_collection_indexes
787787
class TestQuerySetDelete(BaseQuerySetUsage):
788788

789789
@execute_count(9)
@@ -942,7 +942,7 @@ def test_success_case(self):
942942
assert '4' in datas
943943

944944

945-
@requirescollectionindexes
945+
@requires_collection_indexes
946946
class TestInOperator(BaseQuerySetUsage):
947947
@execute_count(1)
948948
def test_kwarg_success_case(self):
@@ -1003,7 +1003,7 @@ class bool_model2(Model):
10031003

10041004

10051005
@greaterthancass20
1006-
@requirescollectionindexes
1006+
@requires_collection_indexes
10071007
class TestContainsOperator(BaseQuerySetUsage):
10081008

10091009
@execute_count(6)
@@ -1069,7 +1069,7 @@ def test_query_expression_success_case(self):
10691069
self.assertEqual(q.count(), 0)
10701070

10711071

1072-
@requirescollectionindexes
1072+
@requires_collection_indexes
10731073
class TestValuesList(BaseQuerySetUsage):
10741074

10751075
@execute_count(2)
@@ -1082,7 +1082,7 @@ def test_values_list(self):
10821082
assert item == 10
10831083

10841084

1085-
@requirescollectionindexes
1085+
@requires_collection_indexes
10861086
class TestObjectsProperty(BaseQuerySetUsage):
10871087
@execute_count(1)
10881088
def test_objects_property_returns_fresh_queryset(self):
@@ -1113,7 +1113,7 @@ class PagingTest(Model):
11131113
assert len(results) == 2
11141114

11151115

1116-
@requirescollectionindexes
1116+
@requires_collection_indexes
11171117
class ModelQuerySetTimeoutTestCase(BaseQuerySetUsage):
11181118
def test_default_timeout(self):
11191119
with mock.patch.object(Session, 'execute') as mock_execute:
@@ -1131,7 +1131,7 @@ def test_none_timeout(self):
11311131
self.assertEqual(mock_execute.call_args[-1]['timeout'], None)
11321132

11331133

1134-
@requirescollectionindexes
1134+
@requires_collection_indexes
11351135
class DMLQueryTimeoutTestCase(BaseQuerySetUsage):
11361136
def setUp(self):
11371137
self.model = TestModel(test_id=1, attempt_id=1, description='timeout test')

tests/integration/cqlengine/statements/test_base_statement.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
from tests.integration.cqlengine.base import BaseCassEngTestCase, TestQueryUpdateModel
2828
from tests.integration.cqlengine import DEFAULT_KEYSPACE
29-
from tests.integration import greaterthanorequalcass3_10, requirescustomindexes, TestCluster
29+
from tests.integration import greaterthanorequalcass3_10, requires_custom_indexes, TestCluster
3030

3131
from cassandra.cqlengine.connection import execute
3232

@@ -102,7 +102,7 @@ def test_insert_statement_execute(self):
102102
self.assertEqual(TestQueryUpdateModel.objects.count(), 0)
103103

104104
@greaterthanorequalcass3_10
105-
@requirescustomindexes
105+
@requires_custom_indexes
106106
def test_like_operator(self):
107107
"""
108108
Test to verify the like operator works appropriately

0 commit comments

Comments
 (0)