benchmarkstt.schema module¶
Defines the main schema for comparison and implements json serialization
-
class
benchmarkstt.schema.
Item
(*args, **kwargs)[source]¶ Bases:
collections.abc.Mapping
Basic structure of each field to compare
- Raises
ValueError, SchemaInvalidItemError
-
class
benchmarkstt.schema.
JSONDecoder
(*args, **kwargs)[source]¶ Bases:
json.decoder.JSONDecoder
Custom 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.JSONEncoder
Custom 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.defaultdict
Containing metadata for an item, such as skipped
-
class
benchmarkstt.schema.
Schema
(data=None)[source]¶ Bases:
object
Basically a list of
Item
-
append
(obj: benchmarkstt.schema.Item)[source]¶
-
-
exception
benchmarkstt.schema.
SchemaError
[source]¶ Bases:
ValueError
Top Error class for all schema related exceptions
-
exception
benchmarkstt.schema.
SchemaInvalidItemError
[source]¶ Bases:
benchmarkstt.schema.SchemaError
Attempting to add an invalid item
-
exception
benchmarkstt.schema.
SchemaJSONError
[source]¶ Bases:
benchmarkstt.schema.SchemaError
When loading incompatible JSON