Skip to content

Stop pytest from picking up non-test classes #395

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 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions tests/integration/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1060,6 +1060,8 @@ def assert_startswith(s, prefix):


class TestCluster(object):
__test__ = False

DEFAULT_PROTOCOL_VERSION = default_protocol_version
DEFAULT_CASSANDRA_IP = CASSANDRA_IP
DEFAULT_ALLOW_BETA = ALLOW_BETA_PROTOCOL
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/cqlengine/advanced/test_cont_paging.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@


class TestMultiKeyModel(models.Model):
__test__ = False

partition = columns.Integer(primary_key=True)
cluster = columns.Integer(primary_key=True)
count = columns.Integer(required=False)
Expand Down
1 change: 1 addition & 0 deletions tests/integration/cqlengine/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from uuid import uuid4

class TestQueryUpdateModel(Model):
__test__ = False

partition = columns.UUID(primary_key=True, default=uuid4)
cluster = columns.Integer(primary_key=True)
Expand Down
8 changes: 8 additions & 0 deletions tests/integration/cqlengine/columns/test_container_columns.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@


class TestSetModel(Model):
__test__ = False

partition = columns.UUID(primary_key=True, default=uuid4)
int_set = columns.Set(columns.Integer, required=False)
text_set = columns.Set(columns.Text, required=False)
Expand Down Expand Up @@ -193,6 +195,7 @@ def test_default_empty_container_saving(self):


class TestListModel(Model):
__test__ = False

partition = columns.UUID(primary_key=True, default=uuid4)
int_list = columns.List(columns.Integer, required=False)
Expand Down Expand Up @@ -347,6 +350,8 @@ def test_blind_list_updates_from_none(self):


class TestMapModel(Model):
__test__ = False

partition = columns.UUID(primary_key=True, default=uuid4)
int_map = columns.Map(columns.Integer, columns.UUID, required=False)
text_map = columns.Map(columns.Text, columns.DateTime, required=False)
Expand Down Expand Up @@ -525,6 +530,7 @@ def test_default_empty_container_saving(self):


class TestCamelMapModel(Model):
__test__ = False

partition = columns.UUID(primary_key=True, default=uuid4)
camelMap = columns.Map(columns.Text, columns.Integer, required=False)
Expand All @@ -546,6 +552,7 @@ def test_camelcase_column(self):


class TestTupleModel(Model):
__test__ = False

partition = columns.UUID(primary_key=True, default=uuid4)
int_tuple = columns.Tuple(columns.Integer, columns.Integer, columns.Integer, required=False)
Expand Down Expand Up @@ -746,6 +753,7 @@ def test_blind_tuple_updates_from_none(self):


class TestNestedModel(Model):
__test__ = False

partition = columns.UUID(primary_key=True, default=uuid4)
list_list = columns.List(columns.List(columns.Integer), required=False)
Expand Down
1 change: 1 addition & 0 deletions tests/integration/cqlengine/columns/test_counter_column.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@


class TestCounterModel(Model):
__test__ = False

partition = columns.UUID(primary_key=True, default=uuid4)
cluster = columns.UUID(primary_key=True, default=uuid4)
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/cqlengine/columns/test_static_column.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
STATIC_SUPPORTED = PROTOCOL_VERSION >= 2

class TestStaticModel(Model):
__test__ = False

partition = columns.UUID(primary_key=True, default=uuid4)
cluster = columns.UUID(primary_key=True, default=uuid4)
static = columns.Text(static=True)
Expand Down
1 change: 1 addition & 0 deletions tests/integration/cqlengine/connections/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@


class TestConnectModel(Model):
__test__ = False

id = columns.Integer(primary_key=True)
keyspace = columns.Text()
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/cqlengine/management/test_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,8 @@ def test_sync_warnings(self):


class TestIndexSetModel(Model):
__test__ = False

partition = columns.UUID(primary_key=True)
int_set = columns.Set(columns.Integer, index=True)
int_list = columns.List(columns.Integer, index=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from cassandra.cqlengine import columns

class TestModel(Model):
__test__ = False

id = columns.UUID(primary_key=True, default=lambda:uuid4())
count = columns.Integer()
Expand Down
5 changes: 5 additions & 0 deletions tests/integration/cqlengine/model/test_model_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@


class TestModel(Model):
__test__ = False

id = columns.UUID(primary_key=True, default=lambda: uuid4())
count = columns.Integer()
Expand All @@ -44,6 +45,8 @@ class TestModel(Model):


class TestModelSave(Model):
__test__ = False

partition = columns.UUID(primary_key=True, default=uuid4)
cluster = columns.Integer(primary_key=True)
count = columns.Integer(required=False)
Expand Down Expand Up @@ -302,6 +305,7 @@ class FloatingPointModel(Model):


class TestMultiKeyModel(Model):
__test__ = False

partition = columns.Integer(primary_key=True)
cluster = columns.Integer(primary_key=True)
Expand Down Expand Up @@ -658,6 +662,7 @@ def test_reserved_cql_words_can_be_used_as_column_names(self):


class TestQueryModel(Model):
__test__ = False

test_id = columns.UUID(primary_key=True, default=uuid4)
date = columns.Date(primary_key=True)
Expand Down
1 change: 1 addition & 0 deletions tests/integration/cqlengine/model/test_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from cassandra.cqlengine.usertype import UserType

class TestUpdateModel(Model):
__test__ = False

partition = columns.UUID(primary_key=True, default=uuid4)
cluster = columns.UUID(primary_key=True, default=uuid4)
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/cqlengine/model/test_value_lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@


class TestModel(Model):
__test__ = False

id = columns.Integer(primary_key=True)
clustering_key = columns.Integer(primary_key=True, clustering_order='desc')

class TestClusteringComplexModel(Model):
__test__ = False

id = columns.Integer(primary_key=True)
clustering_key = columns.Integer(primary_key=True, clustering_order='desc')
Expand Down
1 change: 1 addition & 0 deletions tests/integration/cqlengine/query/test_batch_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@


class TestMultiKeyModel(Model):
__test__ = False

partition = columns.Integer(primary_key=True)
cluster = columns.Integer(primary_key=True)
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/cqlengine/query/test_queryset.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def dst(self, dt):


class TestModel(Model):
__test__ = False

test_id = columns.Integer(primary_key=True)
attempt_id = columns.Integer(primary_key=True)
Expand Down Expand Up @@ -104,6 +105,7 @@ class IndexedCollectionsTestModel(Model):


class TestMultiClusteringModel(Model):
__test__ = False

one = columns.Integer(primary_key=True)
two = columns.Integer(primary_key=True)
Expand Down Expand Up @@ -1346,6 +1348,7 @@ def test_db_field_value_list(self):
list(DBFieldModel.objects.filter(c0=0, k0=0, k1=0).values_list('c0', 'v0'))

class TestModelSmall(Model):
__test__ = False

test_id = columns.Integer(primary_key=True)

Expand Down
2 changes: 2 additions & 0 deletions tests/integration/cqlengine/test_batch_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
from mock import patch

class TestMultiKeyModel(Model):
__test__ = False

partition = columns.Integer(primary_key=True)
cluster = columns.Integer(primary_key=True)
count = columns.Integer(required=False)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/cqlengine/test_connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@


class TestModel(Model):

__test__ = False
__keyspace__ = 'ks1'

partition = columns.Integer(primary_key=True)
Expand Down
1 change: 1 addition & 0 deletions tests/integration/cqlengine/test_consistency.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from tests.integration.cqlengine.base import BaseCassEngTestCase

class TestConsistencyModel(Model):
__test__ = False

id = columns.UUID(primary_key=True, default=lambda:uuid4())
count = columns.Integer()
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/cqlengine/test_context_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@


class TestModel(Model):

__test__ = False
__keyspace__ = 'ks1'

partition = columns.Integer(primary_key=True)
Expand Down
3 changes: 3 additions & 0 deletions tests/integration/cqlengine/test_ifexists.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,23 @@


class TestIfExistsModel(Model):
__test__ = False

id = columns.UUID(primary_key=True, default=lambda: uuid4())
count = columns.Integer()
text = columns.Text(required=False)


class TestIfExistsModel2(Model):
__test__ = False

id = columns.Integer(primary_key=True)
count = columns.Integer(primary_key=True, required=False)
text = columns.Text(required=False)


class TestIfExistsWithCounterModel(Model):
__test__ = False

id = columns.UUID(primary_key=True, default=lambda: uuid4())
likes = columns.Counter()
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/cqlengine/test_ifnotexists.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@
from tests.integration import PROTOCOL_VERSION

class TestIfNotExistsModel(Model):
__test__ = False

id = columns.UUID(primary_key=True, default=lambda:uuid4())
count = columns.Integer()
text = columns.Text(required=False)


class TestIfNotExistsWithCounterModel(Model):
__test__ = False

id = columns.UUID(primary_key=True, default=lambda:uuid4())
likes = columns.Counter()
Expand Down
4 changes: 4 additions & 0 deletions tests/integration/cqlengine/test_lwt_conditional.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,16 @@


class TestConditionalModel(Model):
__test__ = False

id = columns.UUID(primary_key=True, default=uuid4)
count = columns.Integer()
text = columns.Text(required=False)


class TestUpdateModel(Model):
__test__ = False

partition = columns.Integer(primary_key=True)
cluster = columns.Integer(primary_key=True)
value = columns.Integer(required=False)
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/cqlengine/test_timestamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@


class TestTimestampModel(Model):
__test__ = False

id = columns.UUID(primary_key=True, default=lambda:uuid4())
count = columns.Integer()

Expand Down
4 changes: 4 additions & 0 deletions tests/integration/cqlengine/test_ttl.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@


class TestTTLModel(Model):
__test__ = False

id = columns.UUID(primary_key=True, default=lambda: uuid4())
count = columns.Integer()
text = columns.Text(required=False)
Expand All @@ -48,6 +50,8 @@ def tearDownClass(cls):


class TestDefaultTTLModel(Model):
__test__ = False

__options__ = {'default_time_to_live': 20}
id = columns.UUID(primary_key=True, default=lambda:uuid4())
count = columns.Integer()
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/standard/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ def test_in_flight_timeout(self):


class TestHostListener(HostStateListener):
__test__ = False

host_down = None

def on_down(self, host):
Expand Down
Loading