This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra-dtest.git
The following commit(s) were added to refs/heads/trunk by this push:
new 58798b05 Update pytest from 7.0.1 to 8.2.2
58798b05 is described below
commit 58798b05ae4a3deeba69b3f3265117682a0fffcd
Author: Ekaterina Dimitrova <[email protected]>
AuthorDate: Mon Aug 24 11:48:42 2026 +0200
Update pytest from 7.0.1 to 8.2.2
- name the reason argument on every pytest.fail() and pytest.skip() call
- raise pluggy to 1.5.0 and exceptiongroup to 1.2.1, the floors pytest 8.2
requires
- drop log_print from pytest.ini; pytest removed the option in 6.0 and
reports it as unknown from 7.0
packaging stays below 21 because apache/cassandra-ccm at the cassandra-test
tag pins packaging<21, and pytest 8.2.2 needs only packaging>=20.
Upstreamed from datastax/cassandra-dtest
6322dfb40657126594f7bd90e6feacaa0315ba41 and
2896df1f4ebe57da698ec09e36832666ce7451ce
patch by Ekaterina Dimitrova, Jacek Lewandowski, Mick Semb Wever; reviewed
by Brandon Williams, Mick Semb Wever for CASSANDRA-20633
Assisted-by: Claude Code:claude-opus-5
---
auth_test.py | 10 +++++-----
bootstrap_test.py | 4 ++--
cfid_test.py | 2 +-
commitlog_test.py | 2 +-
compaction_test.py | 12 ++++++------
conftest.py | 10 +++++-----
cqlsh_tests/test_cqlsh.py | 6 +++---
cqlsh_tests/util.py | 2 +-
dtest.py | 4 ++--
dtest_setup.py | 2 +-
materialized_views_test.py | 20 ++++++++++----------
mixed_version_test.py | 8 ++++----
native_transport_ssl_test.py | 4 ++--
nodetool_test.py | 2 +-
offline_tools_test.py | 2 +-
paging_test.py | 4 ++--
paxos_test.py | 2 +-
pushed_notifications_test.py | 4 ++--
pytest.ini | 1 -
rebuild_test.py | 8 ++++----
replica_side_filtering_test.py | 4 ++--
requirements.txt | 6 +++---
secondary_indexes_test.py | 12 ++++++------
seed_test.py | 2 +-
sstable_generation_loading_test.py | 2 +-
ttl_test.py | 2 +-
upgrade_tests/cql_tests.py | 8 ++++----
upgrade_tests/drop_compact_storage_upgrade_test.py | 2 +-
upgrade_tests/paging_test.py | 4 ++--
upgrade_tests/upgrade_base.py | 8 ++++----
upgrade_tests/upgrade_through_versions_test.py | 6 +++---
31 files changed, 82 insertions(+), 83 deletions(-)
diff --git a/auth_test.py b/auth_test.py
index 3e751bba..a01f03ce 100644
--- a/auth_test.py
+++ b/auth_test.py
@@ -882,7 +882,7 @@ class TestAuth(AbstractTestAuth):
def check_caching(attempt=0):
attempt += 1
if attempt > 3:
- pytest.fail("Unable to verify cache expiry in 3 attempts,
failing")
+ pytest.fail(reason="Unable to verify cache expiry in 3
attempts, failing")
logger.debug("Attempting to verify cache expiry, attempt
#{i}".format(i=attempt))
# grant SELECT to cathy
@@ -903,7 +903,7 @@ class TestAuth(AbstractTestAuth):
check_caching(attempt)
else:
# legit failure
- pytest.fail("Expecting query to raise an exception,
but nothing was raised.")
+ pytest.fail(reason="Expecting query to raise an
exception, but nothing was raised.")
except Unauthorized as e:
assert re.search("User cathy has no SELECT permission on
<table ks.cf> or any of its parents", str(e))
@@ -2830,7 +2830,7 @@ class TestAuthUnavailable(AbstractTestAuth):
try:
self.patient_exclusive_cql_connection(node0, timeout=2,
user='cassandra', password='cassandra')
- pytest.fail("Expected login attempt to raise an exception.")
+ pytest.fail(reason="Expected login attempt to raise an exception.")
except NoHostAvailable as e:
# From driver
assert isinstance(list(e.errors.values())[0], AuthenticationFailed)
@@ -2869,7 +2869,7 @@ class TestAuthUnavailable(AbstractTestAuth):
try:
self.patient_exclusive_cql_connection(node0, timeout=2,
user='cassandra', password='cassandra')
- pytest.fail("Expected login attempt to raise an exception.")
+ pytest.fail(reason="Expected login attempt to raise an exception.")
except NoHostAvailable as e:
# From driver
assert isinstance(list(e.errors.values())[0], AuthenticationFailed)
@@ -3151,7 +3151,7 @@ class TestNetworkAuth(AbstractTestAuth):
def assertUnauthorized(self, func):
try:
func()
- pytest.fail("Expecting Unauthorized exception")
+ pytest.fail(reason="Expecting Unauthorized exception")
except Unauthorized as _:
pass
except NoHostAvailable as e:
diff --git a/bootstrap_test.py b/bootstrap_test.py
index 6469825e..e9f0c2d1 100644
--- a/bootstrap_test.py
+++ b/bootstrap_test.py
@@ -1025,7 +1025,7 @@ class BootstrapTester(Tester):
try:
node2.nodetool('join')
- pytest.fail('nodetool should have errored and failed to join ring')
+ pytest.fail(reason='nodetool should have errored and failed to
join ring')
except ToolError as t:
assert "Cannot join the ring until bootstrap completes" in t.stdout
@@ -1050,7 +1050,7 @@ class BootstrapTester(Tester):
try:
node3.nodetool('join')
- pytest.fail('nodetool should have errored and failed to join ring')
+ pytest.fail(reason='nodetool should have errored and failed to
join ring')
except ToolError as t:
assert "Cannot join the ring until bootstrap completes" in t.stdout
diff --git a/cfid_test.py b/cfid_test.py
index ec0a6d64..f0f0c3a1 100644
--- a/cfid_test.py
+++ b/cfid_test.py
@@ -32,7 +32,7 @@ class TestCFID(Tester):
try:
cfs = os.listdir(node1.get_path() + "/data0/ks")
except OSError:
- pytest.fail("Path to sstables not valid.")
+ pytest.fail(reason="Path to sstables not valid.")
# check that there are 5 unique directories
assert len(cfs) == 5
diff --git a/commitlog_test.py b/commitlog_test.py
index 1cf9da3d..dcf949ed 100644
--- a/commitlog_test.py
+++ b/commitlog_test.py
@@ -173,7 +173,7 @@ class TestCommitLog(Tester):
"""
cluster_ver = self.cluster.version()
if LooseVersion('3.1') <= cluster_ver < LooseVersion('3.7'):
- pytest.skip("Fixed in 3.0.7 and 3.7")
+ pytest.skip(reason="Fixed in 3.0.7 and 3.7")
node1 = self.node1
node1.set_batch_commitlog(enabled=True, use_batch_window =
self.cluster.version() < '5.0')
diff --git a/compaction_test.py b/compaction_test.py
index c318303b..e71fc5e7 100644
--- a/compaction_test.py
+++ b/compaction_test.py
@@ -194,7 +194,7 @@ class TestCompaction(Tester):
assert not "Data" in afile, afile
except OSError:
- pytest.fail("Path to sstables not valid.")
+ pytest.fail(reason="Path to sstables not valid.")
@pytest.mark.parametrize("strategy", ['DateTieredCompactionStrategy'])
def test_dtcs_deletion(self, strategy):
@@ -208,7 +208,7 @@ class TestCompaction(Tester):
self.skip_if_not_supported(strategy)
if strategy != 'DateTieredCompactionStrategy':
- pytest.skip('Not implemented unless DateTieredCompactionStrategy
is used')
+ pytest.skip(reason='Not implemented unless
DateTieredCompactionStrategy is used')
cluster = self.cluster
cluster.populate(1).start()
@@ -546,7 +546,7 @@ class TestCompaction(Tester):
@jira_ticket CASSANDRA-11550
"""
if not hasattr(self, 'strategy') or strategy !=
'LeveledCompactionStrategy':
- pytest.skip('Not implemented unless LeveledCompactionStrategy is
used')
+ pytest.skip(reason='Not implemented unless
LeveledCompactionStrategy is used')
cluster = self.cluster
cluster.populate(1).start()
@@ -590,13 +590,13 @@ class TestCompaction(Tester):
def skip_if_no_major_compaction(self, strategy):
if self.cluster.version() < '2.2' and strategy ==
'LeveledCompactionStrategy':
- pytest.skip('major compaction not implemented for LCS in this
version of Cassandra')
+ pytest.skip(reason='major compaction not implemented for LCS in
this version of Cassandra')
def skip_if_not_supported(self, strategy):
if self.cluster.version() >= '5.0' and strategy ==
'DateTieredCompactionStrategy':
- pytest.skip('DateTieredCompactionStrategy is not supported in
Cassandra 5.0 and later')
+ pytest.skip(reason='DateTieredCompactionStrategy is not supported
in Cassandra 5.0 and later')
if self.cluster.version() < '5.0' and strategy ==
'UnifiedCompactionStrategy':
- pytest.skip('UnifiedCompactionStrategy is only supported in
Cassandra 5.0 and later')
+ pytest.skip(reason='UnifiedCompactionStrategy is only supported in
Cassandra 5.0 and later')
def grep_sstables_in_each_level(node, table_name):
output = node.nodetool('tablestats').stdout
diff --git a/conftest.py b/conftest.py
index dcd5f47f..5b21a536 100644
--- a/conftest.py
+++ b/conftest.py
@@ -221,8 +221,8 @@ def fixture_maybe_skip_tests_requiring_novnodes(request):
"""
if request.node.get_closest_marker('no_vnodes'):
if request.config.getoption("--use-vnodes"):
- pytest.skip("Skipping test marked with no_vnodes as tests executed
with vnodes enabled via the "
- "--use-vnodes command line argument")
+ pytest.skip(reason="Skipping test marked with no_vnodes as tests
executed with vnodes enabled via the "
+ "--use-vnodes command line argument")
@pytest.fixture(scope='function', autouse=True)
@@ -369,8 +369,8 @@ def fixture_dtest_setup(request,
errors = check_logs_for_errors(dtest_setup)
if len(errors) > 0:
failed = True
- pytest.fail('Unexpected error found in node logs (see stdout
for full details). Errors: [{errors}]'
- .format(errors=str.join(", ", errors)),
pytrace=False)
+ pytest.fail(reason='Unexpected error found in node logs (see
stdout for full details). Errors: [{errors}]'
+ .format(errors=str.join(", ", errors)),
pytrace=False)
finally:
try:
# save the logs for inspection
@@ -545,7 +545,7 @@ def fixture_skip_version(request, fixture_dtest_setup):
if marker is not None:
version_to_skip = LooseVersion(marker.args[0])
if version_to_skip ==
fixture_dtest_setup.dtest_config.cassandra_version_from_build:
- pytest.skip("Test marked not to run on version %s" %
version_to_skip)
+ pytest.skip(reason="Test marked not to run on version %s" %
version_to_skip)
@pytest.fixture(scope='session', autouse=True)
diff --git a/cqlsh_tests/test_cqlsh.py b/cqlsh_tests/test_cqlsh.py
index af433382..7661e187 100644
--- a/cqlsh_tests/test_cqlsh.py
+++ b/cqlsh_tests/test_cqlsh.py
@@ -2969,9 +2969,9 @@ class TestCqlLogin(Tester, CqlshMixin):
if expected_error in err_line:
break
else:
- pytest.fail("Did not find expected error '{}' in "
- "cqlsh stderr output: {}".format(expected_error,
- '\n'.join(err_lines)))
+ pytest.fail(reason="Did not find expected error '{}' in "
+ "cqlsh stderr output: {}".format(expected_error,
+
'\n'.join(err_lines)))
def test_login_allows_bad_pass_and_continued_use(self):
create_ks(self.session, 'ks1', 1)
diff --git a/cqlsh_tests/util.py b/cqlsh_tests/util.py
index 34212cbd..9634009f 100644
--- a/cqlsh_tests/util.py
+++ b/cqlsh_tests/util.py
@@ -12,7 +12,7 @@ def run_cqlsh_safe(node, cmds, cqlsh_options=None,
expect_error=True):
try:
ret = node.run_cqlsh(cmds=cmds, cqlsh_options=cqlsh_options)
if expect_error:
- pytest.fail("Expected ToolError but didn't get one")
+ pytest.fail(reason="Expected ToolError but didn't get one")
return ret
except ToolError as e:
ret = namedtuple('Subprocess_Return', 'stdout stderr rc')
diff --git a/dtest.py b/dtest.py
index b181037b..39ddba97 100644
--- a/dtest.py
+++ b/dtest.py
@@ -260,7 +260,7 @@ class Tester(object):
for path in build_upgrade_pairs():
if from_version.startswith(path.starting_meta.family) and
to_version.startswith(path.upgrade_meta.family):
return None
- pytest.fail("Upgrades from {} to {} are not supported and should not
be tested".format(from_version, to_version))
+ pytest.fail(reason="Upgrades from {} to {} are not supported and
should not be tested".format(from_version, to_version))
def set_node_to_current_version(self, node):
version = os.environ.get('CASSANDRA_VERSION')
@@ -290,7 +290,7 @@ class Tester(object):
try:
node.watch_log_for(msg, timeout=timeout, **kwargs)
except TimeoutError:
- pytest.fail("Log message was not seen within
timeout:\n{0}".format(msg))
+ pytest.fail(reason="Log message was not seen within
timeout:\n{0}".format(msg))
def get_eager_protocol_version(cassandra_version):
diff --git a/dtest_setup.py b/dtest_setup.py
index 712360cc..68a47930 100644
--- a/dtest_setup.py
+++ b/dtest_setup.py
@@ -182,7 +182,7 @@ class DTestSetup(object):
message += "\n{nodename}: {error}".format(nodename=nodename,
error=error)
logger.debug('Errors were just seen in logs, ending test (if not
ending already)!')
- pytest.fail("Error details: \n{message}".format(message=message))
+ pytest.fail(reason="Error details:
\n{message}".format(message=message))
def copy_logs(self, directory=None, name=None):
"""Copy the current cluster's log files somewhere, by default to
LOG_SAVED_DIR with a name of 'last'"""
diff --git a/materialized_views_test.py b/materialized_views_test.py
index e6a5cc35..dd3e9b0f 100644
--- a/materialized_views_test.py
+++ b/materialized_views_test.py
@@ -153,7 +153,7 @@ class TestMaterializedViews(Tester):
elapsed = (time.time() - start) / 60
if elapsed > wait_minutes:
- pytest.fail("The MV build hasn't started in 2 minutes.")
+ pytest.fail(reason="The MV build hasn't started in 2 minutes.")
def _insert_data(self, session):
# insert data
@@ -1419,7 +1419,7 @@ class TestMaterializedViews(Tester):
assert_one(session, "SELECT * FROM mv", [1, 4, 1])
except AssertionError as ae:
if (time.time() - start) >= 100:
- pytest.fail("Please increase the 100 TTL which expired before
we could test due to a slow env.")
+ pytest.fail(reason="Please increase the 100 TTL which expired
before we could test due to a slow env.")
else:
raise ae
@@ -1430,7 +1430,7 @@ class TestMaterializedViews(Tester):
assert_one(session, "SELECT * FROM mv", [1, 5, 1])
except AssertionError as ae:
if (time.time() - start) >= 80:
- pytest.fail("Please increase the 80 TTL which expired before
we could test due to a slow env.")
+ pytest.fail(reason="Please increase the 80 TTL which expired
before we could test due to a slow env.")
else:
raise ae
@@ -1441,7 +1441,7 @@ class TestMaterializedViews(Tester):
assert_one(session, "SELECT * FROM mv", [1, 6, 1])
except AssertionError as ae:
if (time.time() - start) >= 60:
- pytest.fail("Please increase the 60 TTL which expired before
we could test due to a slow env.")
+ pytest.fail(reason="Please increase the 60 TTL which expired
before we could test due to a slow env.")
else:
raise ae
@@ -1452,7 +1452,7 @@ class TestMaterializedViews(Tester):
assert_one(session, "SELECT * FROM mv", [1, 6, 1])
except AssertionError as ae:
if (time.time() - start) >= 60:
- pytest.fail("Please increase the 60 TTL which expired
before we could test due to a slow env.")
+ pytest.fail(reason="Please increase the 60 TTL which
expired before we could test due to a slow env.")
else:
raise ae
@@ -1555,7 +1555,7 @@ class TestMaterializedViews(Tester):
assert_one(session, "SELECT * FROM mv", [1, 1, 1, None])
except AssertionError as ae:
if (time.time() - start) >= 30:
- pytest.fail("Please increase the 30 TTL which expired before
we could test due to a slow env.")
+ pytest.fail(reason="Please increase the 30 TTL which expired
before we could test due to a slow env.")
else:
raise ae
@@ -1571,7 +1571,7 @@ class TestMaterializedViews(Tester):
assert_one(session, "SELECT * FROM mv", [1, 1, None, None])
except AssertionError as ae:
if (time.time() - start) >= 30:
- pytest.fail("Please increase the 30 TTL which expired before
we could test due to a slow env.")
+ pytest.fail(reason="Please increase the 30 TTL which expired
before we could test due to a slow env.")
else:
raise ae
@@ -1926,10 +1926,10 @@ class TestMaterializedViews(Tester):
if expect_digest:
break
else:
- pytest.fail("Encountered digest mismatch when we
shouldn't")
+ pytest.fail(reason="Encountered digest mismatch when we
shouldn't")
else:
if expect_digest:
- pytest.fail("Didn't find digest mismatch")
+ pytest.fail(reason="Didn't find digest mismatch")
def test_simple_repair_by_base(self):
self._simple_repair_test(repair_base=True)
@@ -2922,7 +2922,7 @@ class TestMaterializedViewsConsistency(Tester):
try:
mm = queues[i % processes].get(timeout=60)
except Empty as e:
- pytest.skip("Failed to get range {range} within timeout from
queue. {error}".format(range=i, error=str(e)))
+ pytest.skip(reason="Failed to get range {range} within timeout
from queue. {error}".format(range=i, error=str(e)))
if not mm.out() is None:
logger.debug("\r{}\n" .format(mm.out()))
diff --git a/mixed_version_test.py b/mixed_version_test.py
index e4ad313f..fd68809b 100644
--- a/mixed_version_test.py
+++ b/mixed_version_test.py
@@ -31,7 +31,7 @@ class TestSchemaChanges(Tester):
elif original_version.vstring.startswith('2.1'):
upgraded_version = 'github:apache/cassandra-2.2'
else:
- pytest.skip("This test is only designed to work with 2.0 and 2.1
right now")
+ pytest.skip(reason="This test is only designed to work with 2.0
and 2.1 right now")
# start out with a major behind the previous version
@@ -55,7 +55,7 @@ class TestSchemaChanges(Tester):
try:
session.execute(SimpleStatement("SELECT * FROM test_upgrades.foo",
consistency_level=ConsistencyLevel.ALL))
- pytest.fail("expected failure")
+ pytest.fail(reason="expected failure")
except (ReadTimeout, OperationTimedOut):
logger.debug("Checking node2 for warning in log")
node2.watch_log_for(pattern, timeout=10)
@@ -64,7 +64,7 @@ class TestSchemaChanges(Tester):
try:
session.execute(SimpleStatement("SELECT * FROM test_upgrades.foo",
consistency_level=ConsistencyLevel.ALL,
fetch_size=None))
- pytest.fail("expected failure")
+ pytest.fail(reason="expected failure")
except (ReadTimeout, OperationTimedOut):
logger.debug("Checking node2 for warning in log")
pattern = r".*Got .* command for nonexistent table
test_upgrades.foo.*"
@@ -75,7 +75,7 @@ class TestSchemaChanges(Tester):
for i in range(20):
session.execute(SimpleStatement("SELECT * FROM
test_upgrades.foo WHERE a = %d" % (i,),
consistency_level=ConsistencyLevel.ALL, fetch_size=None))
- pytest.fail("expected failure")
+ pytest.fail(reason="expected failure")
except (ReadTimeout, OperationTimedOut):
logger.debug("Checking node2 for warning in log")
pattern = r".*Got .* command for nonexistent table
test_upgrades.foo.*"
diff --git a/native_transport_ssl_test.py b/native_transport_ssl_test.py
index 0046e572..ba68bc50 100644
--- a/native_transport_ssl_test.py
+++ b/native_transport_ssl_test.py
@@ -36,7 +36,7 @@ class TestNativeTransportSSL(Tester):
try: # hack around assertRaise's lack of msg parameter
# try to connect without ssl options
self.patient_cql_connection(node1)
- pytest.fail('Should not be able to connect to SSL socket without
SSL enabled client')
+ pytest.fail(reason='Should not be able to connect to SSL socket
without SSL enabled client')
except NoHostAvailable:
pass
@@ -78,7 +78,7 @@ class TestNativeTransportSSL(Tester):
cluster.start()
try: # hack around assertRaise's lack of msg parameter
self.patient_cql_connection(node1)
- pytest.fail('Should not be able to connect to non-default port')
+ pytest.fail(reason='Should not be able to connect to non-default
port')
except NoHostAvailable:
pass
diff --git a/nodetool_test.py b/nodetool_test.py
index 1611ff16..ed76fc4c 100644
--- a/nodetool_test.py
+++ b/nodetool_test.py
@@ -349,7 +349,7 @@ class TestNodetool(Tester):
assert 'concurrent_view_builders should be great than 0.' in
e.stdout
assert 'Number of concurrent view builders should be greater than
0.', e.message
else:
- pytest.fail("Expected error when setting and invalid value")
+ pytest.fail(reason="Expected error when setting and invalid value")
@since('4.0')
def test_describecluster_more_information_three_datacenters(self):
diff --git a/offline_tools_test.py b/offline_tools_test.py
index e69786ea..b78ce0c0 100644
--- a/offline_tools_test.py
+++ b/offline_tools_test.py
@@ -355,7 +355,7 @@ class TestOfflineTools(Tester):
# Error opening zip file or JAR manifest missing :
/home/mshuler/git/cassandra/lib/jamm-0.2.5.jar
# The 2.1 installed jamm version is 0.3.0, but bin/cassandra.in.sh
used by nodetool still has 0.2.5
# (when this is fixed in CCM issue #463, install
version='github:apache/cassandra-2.0' as below)
- pytest.skip('Skipping 2.1 test due to jamm.jar version upgrade
problem in CCM node configuration.')
+ pytest.skip(reason='Skipping 2.1 test due to jamm.jar version
upgrade problem in CCM node configuration.')
elif testversion < '3.0':
logger.debug('Test version: {} - installing
github:apache/cassandra-2.1'.format(testversion))
cluster.set_install_dir(version='github:apache/cassandra-2.1')
diff --git a/paging_test.py b/paging_test.py
index c2818eb8..842cb16f 100644
--- a/paging_test.py
+++ b/paging_test.py
@@ -365,7 +365,7 @@ class TestPagingWithModifiers(BasePagingTester,
PageAssertionMixin):
)
else:
# this should not happen
- pytest.fail("Invalid scenario configuration. Scenario is:
{}".format(scenario))
+ pytest.fail(reason="Invalid scenario configuration. Scenario
is: {}".format(scenario))
pf = PageFetcher(future).request_all()
assert pf.num_results_all() == scenario['expect_pgsizes']
@@ -3450,7 +3450,7 @@ class TestPagingWithDeletions(BasePagingTester,
PageAssertionMixin):
except Exception:
raise
else:
- pytest.fail('Expected ReadFailure or ReadTimeout, depending on the
cluster version')
+ pytest.fail(reason='Expected ReadFailure or ReadTimeout, depending
on the cluster version')
if self.cluster.version() < "3.0":
failure_msg = ("Scanned over.* tombstones in test_paging_size."
diff --git a/paxos_test.py b/paxos_test.py
index 5265be4f..efec379c 100644
--- a/paxos_test.py
+++ b/paxos_test.py
@@ -88,7 +88,7 @@ class TestPaxos(Tester):
session.execute("INSERT INTO test (k, v) VALUES (6, 6) IF NOT EXISTS")
def test_contention_multi_iterations(self):
- pytest.skip("Hanging the build")
+ pytest.skip(reason="Hanging the build")
self._contention_test(8, 100)
# Warning, this test will require you to raise the open
diff --git a/pushed_notifications_test.py b/pushed_notifications_test.py
index b0d1b27a..2f834578 100644
--- a/pushed_notifications_test.py
+++ b/pushed_notifications_test.py
@@ -431,7 +431,7 @@ class TestVariousNotifications(Tester):
except Exception:
raise
else:
- pytest.fail('Expected ReadFailure')
+ pytest.fail(reason='Expected ReadFailure')
read_failure_query()
@@ -463,7 +463,7 @@ class TestVariousNotifications(Tester):
except Exception:
raise
else:
- pytest.fail('Expected ReadFailure')
+ pytest.fail(reason='Expected ReadFailure')
range_request_failure_query()
diff --git a/pytest.ini b/pytest.ini
index 138dc62e..4b0ebc28 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -2,7 +2,6 @@
addopts = --show-capture=stdout --timeout=900
python_files = test_*.py *_test.py *_tests.py
junit_suite_name = Cassandra dtests
-log_print = True
log_cli = True
log_cli_level = DEBUG
log_cli_format = %(asctime)s,%(msecs)03d %(name)s %(levelname)s %(message)s
diff --git a/rebuild_test.py b/rebuild_test.py
index 56b1ac4a..97db3db9 100644
--- a/rebuild_test.py
+++ b/rebuild_test.py
@@ -225,14 +225,14 @@ class TestRebuild(Tester):
with pytest.raises(ToolError):
logger.debug('Executing first rebuild -> '),
node3.nodetool('rebuild dc1')
- pytest.fail("Expected: FAILED")
+ pytest.fail(reason="Expected: FAILED")
session.execute('USE ks')
with pytest.raises(AssertionError):
logger.debug('Checking data is complete -> '),
for i in range(0, 20000):
query_c1c2(session, i, ConsistencyLevel.LOCAL_ONE)
- pytest.fail('Expected: INCOMPLETE')
+ pytest.fail(reason='Expected: INCOMPLETE')
logger.debug('Executing second rebuild -> '),
node3.nodetool('rebuild dc1')
@@ -343,7 +343,7 @@ class TestRebuild(Tester):
with pytest.raises(ToolError):
node1.nodetool('rebuild -ks ks1 -ts (%s,%s]' % (node1_token,
node2_token))
- pytest.fail("range should not be owned by this node")
+ pytest.fail(reason="range should not be owned by this node")
@since('3.10')
@pytest.mark.no_vnodes
@@ -380,7 +380,7 @@ class TestRebuild(Tester):
with pytest.raises(ToolError):
node1.nodetool('rebuild -ks ks1 -ts (%s,%s] -s %s' % (node3_token,
node1_token, node3_address))
- pytest.fail("should not find sufficient sources")
+ pytest.fail(reason="should not find sufficient sources")
@since('3.10')
@pytest.mark.no_vnodes
diff --git a/replica_side_filtering_test.py b/replica_side_filtering_test.py
index 0a86d268..c1e4918c 100644
--- a/replica_side_filtering_test.py
+++ b/replica_side_filtering_test.py
@@ -103,11 +103,11 @@ class ReplicaSideFiltering(Tester):
def _skip_if_index_on_static_is_not_supported(self):
if self.create_index() and self.cluster.version() < '3.4':
- pytest.skip('Secondary indexes on static column are not supported
before 3.4 (CASSANDRA-8103)')
+ pytest.skip(reason='Secondary indexes on static column are not
supported before 3.4 (CASSANDRA-8103)')
def _skip_if_filtering_partition_columns_is_not_supported(self):
if not self.create_index() and self.cluster.version() < '3.11':
- pytest.skip('Filtering of partition key parts is not supported
before 3.11 (CASSANDRA-13275)')
+ pytest.skip(reason='Filtering of partition key parts is not
supported before 3.11 (CASSANDRA-13275)')
@abstractmethod
def create_index(self):
diff --git a/requirements.txt b/requirements.txt
index cf908965..945cfe03 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -14,7 +14,7 @@ click==8.0.4
decorator==5.1.1
docopt==0.6.2
enum34==1.1.10
-exceptiongroup==0.0.0a0
+exceptiongroup==1.2.1
flaky==3.8.1
geomet==0.2.1.post1
iniconfig==1.1.1
@@ -23,12 +23,12 @@ mock==5.1.0
netifaces==0.11.0
packaging<21
parse==1.20.1
-pluggy==1.0.0
+pluggy==1.5.0
psutil==5.9.8
py==1.11.0
pycodestyle==2.10.0
pyparsing==3.1.2
-pytest==7.0.1
+pytest==8.2.2
pytest-repeat==0.9.1
pytest-timeout==2.1.0
PyYAML==6.0.1
diff --git a/secondary_indexes_test.py b/secondary_indexes_test.py
index eee7a02c..7865bec4 100644
--- a/secondary_indexes_test.py
+++ b/secondary_indexes_test.py
@@ -130,7 +130,7 @@ class TestSecondaryIndexes(Tester):
assert expected_per_range > 0
break
else:
- pytest.fail("Didn't find matching trace event")
+ pytest.fail(reason="Didn't find matching trace event")
query = SimpleStatement("SELECT * FROM ks.cf WHERE b='1';")
result = session.execute(query, trace=True)
@@ -304,7 +304,7 @@ class TestSecondaryIndexes(Tester):
def _execute_and_fail(self, operation, cql_string):
try:
operation()
- pytest.fail("Expecting query {} to be invalid".format(cql_string))
+ pytest.fail(reason="Expecting query {} to be
invalid".format(cql_string))
except AssertionError as e:
raise e
except InvalidRequest:
@@ -591,10 +591,10 @@ class TestSecondaryIndexes(Tester):
on_failure(trace, regex, expected_matches, match_counts,
event_source, min_matches, max_matches)
def halt_on_failure(trace, regex, expected_matches, match_counts,
event_source, min_expected, max_expected):
- pytest.fail("Expected to find between {min} and {max} trace events
matching {pattern} from {source}, "
- "but actually found {actual}. (Full counts: {all})"
- .format(min=min_expected, max=max_expected,
pattern=regex, source=event_source,
- actual=match_counts[event_source],
all=match_counts))
+ pytest.fail(reason="Expected to find between {min} and {max} trace
events matching {pattern} from {source}, "
+ "but actually found {actual}. (Full counts:
{all})"
+ .format(min=min_expected, max=max_expected,
pattern=regex, source=event_source,
+ actual=match_counts[event_source],
all=match_counts))
def retry_on_failure(trace, regex, expected_matches, match_counts,
event_source, min_expected, max_expected):
logger.debug("Trace event inspection did not match expected,
sleeping before re-fetching trace events. "
diff --git a/seed_test.py b/seed_test.py
index 090d493c..be9fe242 100644
--- a/seed_test.py
+++ b/seed_test.py
@@ -38,7 +38,7 @@ class TestGossiper(Tester):
except Exception as e:
raise e
else:
- pytest.fail("Expecting startup to raise a TimeoutError, but
nothing was raised.")
+ pytest.fail(reason="Expecting startup to raise a TimeoutError, but
nothing was raised.")
@since('3.11.2', max_version='5.0.x')
def test_startup_non_seed_with_peers(self):
diff --git a/sstable_generation_loading_test.py
b/sstable_generation_loading_test.py
index 7e9291d9..8b0bab1d 100644
--- a/sstable_generation_loading_test.py
+++ b/sstable_generation_loading_test.py
@@ -44,7 +44,7 @@ class BaseSStableLoaderTester(Tester):
def skip_base_class_test(self):
if self.__class__.__name__ != 'TestBasedSSTableLoader' and
self.upgrade_from is None:
- pytest.skip("Don't need to run base class test, only derived
classes")
+ pytest.skip(reason="Don't need to run base class test, only
derived classes")
def create_schema_40(self, session, ks, compression):
create_ks(session, ks, rf=2)
diff --git a/ttl_test.py b/ttl_test.py
index 5fc171ae..965e1eb6 100644
--- a/ttl_test.py
+++ b/ttl_test.py
@@ -390,7 +390,7 @@ class TestTTL(Tester):
result = self.session1.execute_async(query + ";")
result.result()
if policy == 'REJECT' and overflow_policy_applies:
- pytest.fail("should throw InvalidRequest")
+ pytest.fail(reason="should throw InvalidRequest")
if self.cluster.version() >= '3.0' and overflow_policy_applies: #
client warn only on 3.0+
if policy == 'CAP':
logger.debug("Warning is {}".format(result.warnings[0]))
diff --git a/upgrade_tests/cql_tests.py b/upgrade_tests/cql_tests.py
index 2712ccc8..a12fa50f 100644
--- a/upgrade_tests/cql_tests.py
+++ b/upgrade_tests/cql_tests.py
@@ -88,7 +88,7 @@ class TestCQL(UpgradeTester):
""" For large collections, make sure that we are printing warnings """
for version in self.get_node_versions():
if version >= '3.0':
- pytest.skip('version {} not compatible with protocol version
2'.format(version))
+ pytest.skip(reason='version {} not compatible with protocol
version 2'.format(version))
# We only warn with protocol 2
cursor = self.prepare(protocol_version=2)
@@ -1572,9 +1572,9 @@ class TestCQL(UpgradeTester):
upgrade_to_version = self.get_node_version(is_upgraded=True)
if LooseVersion('3.0.0') <= upgrade_to_version <=
LooseVersion('3.0.6'):
- pytest.skip('CASSANDRA-11930 was fixed in 3.0.7 and 3.7')
+ pytest.skip(reason='CASSANDRA-11930 was fixed in 3.0.7 and
3.7')
elif LooseVersion('3.1') <= upgrade_to_version <=
LooseVersion('3.6'):
- pytest.skip('CASSANDRA-11930 was fixed in 3.0.7 and 3.7')
+ pytest.skip(reason='CASSANDRA-11930 was fixed in 3.0.7 and
3.7')
session.execute("TRUNCATE ks.cf")
@@ -5211,7 +5211,7 @@ class TestCQL(UpgradeTester):
# since the protocol requires strings to be valid UTF-8, the error
response to this is a ProtocolError
try:
cursor.execute("insert into ks.invalid_string_literals (k, b)
VALUES (0, '\xc2\x01')")
- pytest.fail("Expected error")
+ pytest.fail(reason="Expected error")
except ProtocolException as e:
assert "Cannot decode string as UTF8" in str(e)
diff --git a/upgrade_tests/drop_compact_storage_upgrade_test.py
b/upgrade_tests/drop_compact_storage_upgrade_test.py
index 0b05c421..7766282d 100644
--- a/upgrade_tests/drop_compact_storage_upgrade_test.py
+++ b/upgrade_tests/drop_compact_storage_upgrade_test.py
@@ -45,7 +45,7 @@ class TestDropCompactStorage(Tester):
def drop_compact_storage(self, session, *args):
try:
session.execute("ALTER TABLE drop_compact_storage_test.test DROP
COMPACT STORAGE")
- pytest.fail("No exception has been thrown")
+ pytest.fail(reason="No exception has been thrown")
except InvalidRequest as e:
for _ in args:
assert _ in str(e)
diff --git a/upgrade_tests/paging_test.py b/upgrade_tests/paging_test.py
index 8880e9b8..a26e0368 100644
--- a/upgrade_tests/paging_test.py
+++ b/upgrade_tests/paging_test.py
@@ -660,8 +660,8 @@ class TestPagingData(BasePagingTester, PageAssertionMixin):
min_version = min(self.get_node_versions())
latest_version_with_bug = '2.2.3'
if min_version <= latest_version_with_bug:
- pytest.skip('known bug released in {latest_ver} and earlier
(current min version {min_ver}); '
-
'skipping'.format(latest_ver=latest_version_with_bug, min_ver=min_version))
+ pytest.skip(reason='known bug released in {latest_ver} and
earlier (current min version {min_ver}); '
+
'skipping'.format(latest_ver=latest_version_with_bug, min_ver=min_version))
logger.debug("Querying %s node" % ("upgraded" if is_upgraded else
"old",))
cursor.execute("TRUNCATE test")
diff --git a/upgrade_tests/upgrade_base.py b/upgrade_tests/upgrade_base.py
index 6b2f53ed..ee2f25ae 100644
--- a/upgrade_tests/upgrade_base.py
+++ b/upgrade_tests/upgrade_base.py
@@ -180,12 +180,12 @@ class UpgradeTester(Tester, metaclass=ABCMeta):
# The since decorator can only check the starting version of the
upgrade,
# so here we check to new version of the upgrade as well.
if hasattr(self, 'max_version') and self.max_version is not None and
new_version_from_build >= self.max_version:
- pytest.skip("Skipping test, new version {} is equal to or higher
than "
- "max version {}".format(new_version_from_build,
self.max_version))
+ pytest.skip(reason="Skipping test, new version {} is equal to or
higher than "
+ "max version {}".format(new_version_from_build,
self.max_version))
if (new_version_from_build >= '3' and self.protocol_version is not
None and self.protocol_version < 3):
- pytest.skip('Protocol version {} incompatible '
- 'with Cassandra version
{}'.format(self.protocol_version, new_version_from_build))
+ pytest.skip(reason='Protocol version {} incompatible '
+ 'with Cassandra version
{}'.format(self.protocol_version, new_version_from_build))
node1.set_log_level(logging.getLevelName(logging.root.level))
node1.set_configuration_options(values={'internode_compression':
'none'})
diff --git a/upgrade_tests/upgrade_through_versions_test.py
b/upgrade_tests/upgrade_through_versions_test.py
index b1354315..fd297f0b 100644
--- a/upgrade_tests/upgrade_through_versions_test.py
+++ b/upgrade_tests/upgrade_through_versions_test.py
@@ -356,10 +356,10 @@ class TestUpgrade(Tester):
def prepare(self):
if type(self).__name__ == "TestUpgrade":
- pytest.skip("Skip base class, only generated classes run the
tests")
+ pytest.skip(reason="Skip base class, only generated classes run
the tests")
if len(self.test_version_metas) < 2: # need at least two versions to
upgrade through - if it is less, it means that we cannot find needed JDKs for
running all versions
- pytest.skip("Skipping upgrade test, not enough versions to upgrade
through: {} - see the previous messages for more information".format(metas))
+ pytest.skip(reason="Skipping upgrade test, not enough versions to
upgrade through: {} - see the previous messages for more
information".format(metas))
logger.debug("Upgrade test beginning, setting CASSANDRA_VERSION to {},
and jdk to {}. (Prior values will be restored after test)."
.format(self.test_version_metas[0].version,
self.test_version_metas[0].java_version))
@@ -804,7 +804,7 @@ class TestUpgrade(Tester):
actual_num_rows = result[0][0]
assert actual_num_rows == expected_num_rows, "SELECT COUNT(*)
returned %s when expecting %s" % (actual_num_rows, expected_num_rows)
else:
- pytest.fail("Count query did not return")
+ pytest.fail(reason="Count query did not return")
class BootstrapMixin(object):
"""
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]