darrenburns / pytest-clarity

A plugin to improve the output of pytest with colourful unified diffs
MIT License
439 stars 23 forks source link

Check types are identical for probably_missing_eq #1

Closed khusrokarim closed 6 years ago

khusrokarim commented 6 years ago

Currently, probably_missing_eq compares types using isinstance rather than identity. This means that

  1. assert item_of_subclass == item_of_class produces a message stating that the items are equal in type;
  2. assert item_of_class == item_of_subcless does not produce a similar message; and
  3. the output also states that values are identical, even if the class and subclass have different class-level attribute values.

Using identity comparison solves all of that.