test_results
TestResults class implementation.
TestResults
Bases: Artifact
TestResults represents a the results for a TestSuite.
Source code in mlte/results/test_results.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | |
results = results
instance-attribute
The validation results for the test_suite, by test case.
test_suite = test_suite
instance-attribute
The id of the TestSuite that we validated.
type = ArtifactType.TEST_RESULTS
class-attribute
instance-attribute
Class attribute indicating type.
__eq__(other)
Test TestResults instance for equality.
Source code in mlte/results/test_results.py
169 170 171 172 173 | |
__init__(test_suite, identifier=None, results={})
Initialize a TestResults instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
identifier
|
Optional[str]
|
An id for this set of test results. |
None
|
test_suite
|
TestSuite
|
The TestSuite |
required |
results
|
dict[str, Result]
|
The validation Results for the TestSuite |
{}
|
Source code in mlte/results/test_results.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | |
convert_result(test_case_id, result_type, message)
Converts a given Info result into the provided type.
Source code in mlte/results/test_results.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | |
from_model(model)
classmethod
Deserialize TestResults content from model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
BaseModel
|
The model |
required |
Returns:
| Type | Description |
|---|---|
TestResults
|
The deserialized specification |
Source code in mlte/results/test_results.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | |
load(identifier=None)
classmethod
Load a TestResults from the configured global session.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
identifier
|
Optional[str]
|
The identifier for the artifact. If None, the default id is used. |
None
|
Source code in mlte/results/test_results.py
117 118 119 120 121 122 123 124 125 | |
print_results(result_type='all')
Prints the validated results per test case, can be filtered by result type.
Source code in mlte/results/test_results.py
131 132 133 134 135 136 137 138 139 140 | |
to_model()
Generates a model representation of the TestResults.
Returns:
| Type | Description |
|---|---|
ArtifactModel
|
The serialized model |
Source code in mlte/results/test_results.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | |