benchmarkstt.schema module¶
Defines the main schema for comparison and implements json serialization
-
class
benchmarkstt.schema.Item(*args, **kwargs)[source]¶ Bases:
collections.abc.MappingBasic structure of each field to compare
- Raises
ValueError, SchemaInvalidItemError
-
class
benchmarkstt.schema.JSONDecoder(*args, **kwargs)[source]¶ Bases:
json.decoder.JSONDecoderCustom JSON decoding for schema
-
class
benchmarkstt.schema.JSONEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]¶ Bases:
json.encoder.JSONEncoderCustom JSON encoding for schema
-
default(o)[source]¶ Implement this method in a subclass such that it returns a serializable object for
o, or calls the base implementation (to raise aTypeError).For example, to support arbitrary iterators, you could implement default like this:
def default(self, o): try: iterable = iter(o) except TypeError: pass else: return list(iterable) # Let the base class default method raise the TypeError return JSONEncoder.default(self, o)
-
-
class
benchmarkstt.schema.Meta[source]¶ Bases:
collections.defaultdictContaining metadata for an item, such as skipped
-
class
benchmarkstt.schema.Schema(data=None)[source]¶ Bases:
objectBasically a list of
Item-
append(obj: benchmarkstt.schema.Item)[source]¶
-
-
exception
benchmarkstt.schema.SchemaError[source]¶ Bases:
ValueErrorTop Error class for all schema related exceptions
-
exception
benchmarkstt.schema.SchemaInvalidItemError[source]¶ Bases:
benchmarkstt.schema.SchemaErrorAttempting to add an invalid item
-
exception
benchmarkstt.schema.SchemaJSONError[source]¶ Bases:
benchmarkstt.schema.SchemaErrorWhen loading incompatible JSON