Go to the documentation of this file.
30 """Unit test utilities for gtest_json_output."""
36 """Normalize output object.
39 obj: Google Test's JSON output object to normalize.
42 Normalized output without any references to transient information that may
43 change from run to run.
45 def _normalize(key, value):
47 return re.sub(
r'^\d+(\.\d+)?s$',
'*', value)
48 elif key ==
'timestamp':
49 return re.sub(
r'^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\dZ$',
'*', value)
50 elif key ==
'failure':
51 value = re.sub(
r'^.*[/\\](.*:)\d+\n',
'\\1*\n', value)
52 return re.sub(
r'Stack trace:\n(.|\n)*',
'Stack trace:\n*', value)
55 if isinstance(obj, dict):
56 return {k: _normalize(k, v)
for k, v
in obj.items()}
57 if isinstance(obj, list):
grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:54