@@ -20,42 +20,55 @@ def supports_page_retirement(device):
2020 return False
2121
2222
23- def test_page_retirement_notsupported (for_all_devices ):
23+ def test_page_retirement_notsupported (all_devices ):
2424 """
2525 Verifies that on platforms that don't supports page retirement, APIs will return Not Supported
2626 """
27- device = for_all_devices
27+ skip_reasons = set ()
2828
29- if supports_page_retirement (device ):
30- pytest .skip ("page_retirement not supported" )
29+ for device in all_devices :
30+ if supports_page_retirement (device ):
31+ skip_reasons .add (f"page_retirement is supported for { device } " )
32+ continue
3133
32- if not util .supports_ecc (device ):
33- pytest .skip ("device doesn't support ECC" )
34+ if not util .supports_ecc (device ):
35+ skip_reasons .add (f"device doesn't support ECC for { device } " )
36+ continue
3437
35- with pytest .raises (nvml .NotSupportedError ):
36- for source in PAGE_RETIREMENT_PUBLIC_CAUSE_TYPES :
37- nvml .device_get_retired_pages (device , source )
38+ with pytest .raises (nvml .NotSupportedError ):
39+ for source in PAGE_RETIREMENT_PUBLIC_CAUSE_TYPES :
40+ nvml .device_get_retired_pages (device , source )
3841
39- with pytest .raises (nvml .NotSupportedError ):
40- nvml .device_get_retired_pages_pending_status (device )
42+ with pytest .raises (nvml .NotSupportedError ):
43+ nvml .device_get_retired_pages_pending_status (device )
4144
45+ if skip_reasons :
46+ pytest .skip (" ; " .join (skip_reasons ))
4247
43- def test_page_retirement_supported (for_all_devices ):
48+
49+ def test_page_retirement_supported (all_devices ):
4450 """
4551 Verifies that on platforms that support page_retirement, APIs will return success
4652 """
47- device = for_all_devices
53+ skip_reasons = set ()
4854
49- if not supports_page_retirement (device ):
50- pytest .skip ("page_retirement not supported" )
55+ for device in all_devices :
56+ if not supports_page_retirement (device ):
57+ skip_reasons .add (f"page_retirement not supported for { device } " )
58+ continue
5159
52- if not util .supports_ecc (device ):
53- pytest .skip ("device doesn't support ECC" )
60+ if not util .supports_ecc (device ):
61+ skip_reasons .add (f"device doesn't support ECC for { device } " )
62+ continue
5463
55- try :
56- for source in PAGE_RETIREMENT_PUBLIC_CAUSE_TYPES :
57- nvml .device_get_retired_pages (device , source )
58- except nvml .NotSupportedError :
59- pytest .skip ("Exception case: Page retirment is not supported in this GPU" )
64+ try :
65+ for source in PAGE_RETIREMENT_PUBLIC_CAUSE_TYPES :
66+ nvml .device_get_retired_pages (device , source )
67+ except nvml .NotSupportedError :
68+ skip_reasons .add (f"Exception case: Page retirement is not supported in this GPU { device } " )
69+ continue
70+
71+ nvml .device_get_retired_pages_pending_status (device )
6072
61- nvml .device_get_retired_pages_pending_status (device )
73+ if skip_reasons :
74+ pytest .skip (" ; " .join (skip_reasons ))
0 commit comments