Skip to content

Commit a8faa90

Browse files
committed
Use pytest.mark.xfail
instead of unittest.expectedFailure. The former has a `reason` argument, and this reason is shown in test report - so it's easier to judge wheter the test should really fail.
1 parent def770c commit a8faa90

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

tests/integration/standard/test_metadata.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import os
2424
from packaging.version import Version
2525
from mock import Mock, patch
26+
import pytest
2627

2728
from cassandra import AlreadyExists, SignatureDescriptor, UserFunctionDescriptor, UserAggregateDescriptor
2829

@@ -1209,7 +1210,7 @@ def test_export_keyspace_schema_udts(self):
12091210
cluster.shutdown()
12101211

12111212
@greaterthancass21
1212-
@unittest.expectedFailure
1213+
@pytest.mark.xfail(reason='Column name in CREATE INDEX is not quoted. It\'s a bug in driver or in Scylla')
12131214
def test_case_sensitivity(self):
12141215
"""
12151216
Test that names that need to be escaped in CREATE statements are
@@ -1279,7 +1280,7 @@ def test_already_exists_exceptions(self):
12791280
cluster.shutdown()
12801281

12811282
@local
1282-
@unittest.expectedFailure
1283+
@pytest.mark.xfail(reason='AssertionError: \'RAC1\' != \'r1\' - probably a bug in driver or in Scylla')
12831284
def test_replicas(self):
12841285
"""
12851286
Ensure cluster.metadata.get_replicas return correctly when not attached to keyspace

tests/integration/standard/test_query.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import unittest
1919
import logging
20+
import pytest
2021
from cassandra import ProtocolVersion
2122
from cassandra import ConsistencyLevel, Unavailable, InvalidRequest, cluster
2223
from cassandra.query import (PreparedStatement, BoundStatement, SimpleStatement,
@@ -1036,8 +1037,7 @@ def test_empty_batch_statement(self):
10361037
with self.assertRaises(RuntimeError):
10371038
results.was_applied
10381039

1039-
# Skipping until PYTHON-943 is resolved
1040-
@unittest.expectedFailure
1040+
@pytest.mark.xfail(reason='Skipping until PYTHON-943 is resolved')
10411041
def test_was_applied_batch_string(self):
10421042
batch_statement = BatchStatement(BatchType.LOGGED)
10431043
batch_statement.add_all(["INSERT INTO test3rf.lwt_clustering (k, c, v) VALUES (0, 0, 10);",

0 commit comments

Comments
 (0)