Skip to content

Commit be1e752

Browse files
authored
chore: avoid some warnings when running cuda.core tests (#2515)
1 parent 0e6d282 commit be1e752

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

cuda_core/pytest.ini

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

@@ -11,3 +11,5 @@ markers =
1111
agent_authored(model): agent-authored test not yet materially human-reviewed
1212
human_reviewed: agent-authored test materially reviewed or rewritten by a human
1313
human_authored: test authored primarily by a human
14+
thread_unsafe(reason): test is not safe to run concurrently with other tests (e.g. uses mocks, patches globals, or mutates shared CUDA state)
15+
parallel_threads_limit(n): cap the number of parallel threads pytest-run-parallel uses for this test or module

cuda_core/tests/system/test_system_device.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,7 @@ def test_cooler():
684684
assert all(isinstance(t, typing.CoolerTarget) for t in target)
685685

686686

687+
@pytest.mark.filterwarnings("ignore::DeprecationWarning")
687688
def test_temperature():
688689
for device in system.Device.get_all_devices():
689690
temperature = device.temperature
@@ -695,6 +696,9 @@ def test_temperature():
695696

696697
# By docs, should be supported on KEPLER or newer, but experimentally,
697698
# is also unsupported on other hardware.
699+
# get_threshold emits DeprecationWarning for some thresholds on Ada+;
700+
# that behaviour is tested separately in
701+
# test_temperature_threshold_unrecognized_device_arch.
698702
with unsupported_before(device, None):
699703
for threshold in list(typing.TemperatureThresholds):
700704
t = temperature.get_threshold(threshold)

cuda_core/tests/test_object_protocols.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ def test_hash_distinct_same_type(a_name, b_name, request):
750750
assert hash(obj_a) != hash(obj_b) # extremely unlikely
751751

752752

753-
@pytest.mark.parametrize("a_name,b_name", itertools.combinations(HASH_TYPES, 2))
753+
@pytest.mark.parametrize("a_name,b_name", list(itertools.combinations(HASH_TYPES, 2)))
754754
def test_hash_distinct_cross_type(a_name, b_name, request):
755755
"""Distinct objects of different types have different hashes."""
756756
obj_a = request.getfixturevalue(a_name)
@@ -774,7 +774,7 @@ def test_equality_basic(fixture_name, request):
774774
assert obj != obj.handle
775775

776776

777-
@pytest.mark.parametrize("a_name,b_name", itertools.combinations(EQ_TYPES, 2))
777+
@pytest.mark.parametrize("a_name,b_name", list(itertools.combinations(EQ_TYPES, 2)))
778778
def test_no_cross_type_equality(a_name, b_name, request):
779779
"""No two distinct objects of different types should compare equal."""
780780
obj_a = request.getfixturevalue(a_name)

0 commit comments

Comments
 (0)