You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When utilizing dataclasses you can define them to be identified by it's attributes. It'd be nice if rather than doing the "GeneralRepr" solution, you would simply use the dir(obj) when making a snapshot of a given dataclass, rather than simply using the __repr__ version. It also makes it a whole lot more difficult to check the diffs when looking at two lists of dataclasses.
In general i wish your lovely module had some custom way of doing the snapshot representation of a given class, if predefined.
i.e a config where you could create a function like:
So it'd be possible to improve the snapshots a bit without having to do a whole lot of bootstrapping for each individual test and/or override __repr__ to return a non-string, which i think is bad practice.
The text was updated successfully, but these errors were encountered:
When utilizing dataclasses you can define them to be identified by it's attributes. It'd be nice if rather than doing the "GeneralRepr" solution, you would simply use the
dir(obj)
when making a snapshot of a given dataclass, rather than simply using the__repr__
version. It also makes it a whole lot more difficult to check the diffs when looking at two lists of dataclasses.In general i wish your lovely module had some custom way of doing the snapshot representation of a given class, if predefined.
i.e a config where you could create a function like:
Something..
So it'd be possible to improve the snapshots a bit without having to do a whole lot of bootstrapping for each individual test and/or override
__repr__
to return a non-string, which i think is bad practice.The text was updated successfully, but these errors were encountered: