Skip to content

Commit 7eb58b1

Browse files
committed
Fixup: devices should be a class variable
1 parent 398f9c9 commit 7eb58b1

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/numba/openmp/tests/test_openmp.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3148,19 +3148,19 @@ class TestOpenmpTarget(TestOpenmpBase):
31483148

31493149
@classmethod
31503150
def setUpClass(cls):
3151-
devices = []
3151+
cls.devices = []
31523152
assert TestOpenmpBase.test_device, (
31533153
"Expected env var TEST_DEVICE to specify the test target device (e.g. 'host' or 'gpu')"
31543154
)
31553155

3156-
devices = find_device_ids(type=TestOpenmpBase.test_device)
3157-
assert devices, (
3156+
cls.devices = find_device_ids(type=TestOpenmpBase.test_device)
3157+
assert cls.devices, (
31583158
f"Expected non-empty test devices list, no device with type {TestOpenmpBase.test_device} found"
31593159
)
31603160

31613161
# Use only the first device.
3162-
devices = [int(devices[0])]
3163-
print(f"Testing OpenMP target offloading on device: {devices}")
3162+
cls.devices = [int(cls.devices[0])]
3163+
print(f"Testing OpenMP target offloading on device: {cls.devices}")
31643164

31653165
def __init__(self, *args):
31663166
TestOpenmpBase.__init__(self, *args)

0 commit comments

Comments
 (0)