File tree 1 file changed +5
-2
lines changed 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 2
2
Unit or integration tests for gpustat
3
3
"""
4
4
# flake8: ignore=E501
5
+ # pyright: reportGeneralTypeIssues=false
6
+ # pylint: disable=protected-access,no-member
5
7
6
8
import ctypes
7
9
import os
10
+ import re
8
11
import shlex
9
12
import sys
10
13
import types
23
26
24
27
25
28
def remove_ansi_codes (s ):
26
- import re
27
29
s = re .compile (r'\x1b[^m]*m' ).sub ('' , s )
28
30
s = re .compile (r'\x0f' ).sub ('' , s )
29
31
return s
@@ -63,6 +65,8 @@ def _callable(*args, **kwargs):
63
65
return v
64
66
return _callable
65
67
68
+ mock_memory_t = namedtuple ("Memory_t" , ['total' , 'used' ]) # c_nvmlMemory_t
69
+
66
70
for i in range (NUM_GPUS ):
67
71
handle = mock_gpu_handles [i ]
68
72
if _scenario_failing_one_gpu and i == 2 : # see #81, #125
@@ -101,7 +105,6 @@ def _callable(*args, **kwargs):
101
105
}[i ]))
102
106
103
107
# see also: NvidiaDriverMock
104
- mock_memory_t = namedtuple ("Memory_t" , ['total' , 'used' ]) # c_nvmlMemory_t
105
108
when (N ).nvmlDeviceGetMemoryInfo (handle )\
106
109
.thenAnswer (_return_or_raise ({
107
110
0 : mock_memory_t (total = 12883853312 , used = 8000 * MB ),
You can’t perform that action at this time.
0 commit comments