@@ -21,42 +21,55 @@ def supports_page_retirement(device):
2121 return False
2222
2323
24- def test_page_retirement_notsupported (for_all_devices ):
24+ def test_page_retirement_notsupported (all_devices ):
2525 """
2626 Verifies that on platforms that don't supports page retirement, APIs will return Not Supported
2727 """
28- device = for_all_devices
28+ skip_reasons = set ()
2929
30- if supports_page_retirement (device ):
31- pytest .skip ("page_retirement not supported" )
30+ for device in all_devices :
31+ if supports_page_retirement (device ):
32+ skip_reasons .add (f"page_retirement is supported for { device } " )
33+ continue
3234
33- if not util .supports_ecc (device ):
34- pytest .skip ("device doesn't support ECC" )
35+ if not util .supports_ecc (device ):
36+ skip_reasons .add (f"device doesn't support ECC for { device } " )
37+ continue
3538
36- with pytest .raises (nvml .NotSupportedError ):
37- for source in PAGE_RETIREMENT_PUBLIC_CAUSE_TYPES :
38- nvml .device_get_retired_pages (device , source )
39+ with pytest .raises (nvml .NotSupportedError ):
40+ for source in PAGE_RETIREMENT_PUBLIC_CAUSE_TYPES :
41+ nvml .device_get_retired_pages (device , source )
3942
40- with pytest .raises (nvml .NotSupportedError ):
41- nvml .device_get_retired_pages_pending_status (device )
43+ with pytest .raises (nvml .NotSupportedError ):
44+ nvml .device_get_retired_pages_pending_status (device )
4245
46+ if skip_reasons :
47+ pytest .skip (" ; " .join (skip_reasons ))
4348
44- def test_page_retirement_supported (for_all_devices ):
49+
50+ def test_page_retirement_supported (all_devices ):
4551 """
4652 Verifies that on platforms that support page_retirement, APIs will return success
4753 """
48- device = for_all_devices
54+ skip_reasons = set ()
4955
50- if not supports_page_retirement (device ):
51- pytest .skip ("page_retirement not supported" )
56+ for device in all_devices :
57+ if not supports_page_retirement (device ):
58+ skip_reasons .add (f"page_retirement not supported for { device } " )
59+ continue
5260
53- if not util .supports_ecc (device ):
54- pytest .skip ("device doesn't support ECC" )
61+ if not util .supports_ecc (device ):
62+ skip_reasons .add (f"device doesn't support ECC for { device } " )
63+ continue
5564
56- try :
57- for source in PAGE_RETIREMENT_PUBLIC_CAUSE_TYPES :
58- nvml .device_get_retired_pages (device , source )
59- except nvml .NotSupportedError :
60- pytest .skip ("Exception case: Page retirment is not supported in this GPU" )
65+ try :
66+ for source in PAGE_RETIREMENT_PUBLIC_CAUSE_TYPES :
67+ nvml .device_get_retired_pages (device , source )
68+ except nvml .NotSupportedError :
69+ skip_reasons .add (f"Exception case: Page retirement is not supported in this GPU { device } " )
70+ continue
71+
72+ nvml .device_get_retired_pages_pending_status (device )
6173
62- nvml .device_get_retired_pages_pending_status (device )
74+ if skip_reasons :
75+ pytest .skip (" ; " .join (skip_reasons ))
0 commit comments