Correct issue with test on Python 3.9

This commit is contained in:
nicolargo 2025-12-20 10:36:00 +01:00
parent 184e490660
commit 59d54b8e2b
1 changed files with 5 additions and 1 deletions

View File

@ -365,7 +365,11 @@ class TestGlances(unittest.TestCase):
def test_014_gpu(self):
"""Check GPU plugin."""
print('INFO: [TEST_014] Check GPU stats')
stats_grab = stats.get_plugin('gpu').get_raw()
gpu_plugin = stats.get_plugin('gpu')
if not gpu_plugin:
print('INFO: GPU plugin is disabled, skipping test')
return
stats_grab = gpu_plugin.get_raw()
self.assertTrue(isinstance(stats_grab, list), msg='GPU stats is not a list')
print(f'INFO: GPU stats: {stats_grab}')