Documentation: misleading deep inspection #411
Labels
good first issue
easy issue that is friendly to new contributor
type: docs
documentation improvement, missing or needing clarification
type: enhancement
new feature or API change, should be merged into features branch
Originally reported by: BitBucket: PeterSlickers, GitHub: PeterSlickers
I recently started using pytest und thus read some the documentation.
On page "http://pytest.org/latest/assert.html" in section "Defining your own assertion comparison" I found an example 'test_foocompare.py'.
Class 'foo' is very simple and it does not define any of Pythons magic methods for comparison like ne, cmp etc. Thus, a comparison of two instances of Foo will be accomplished by comparing the unique ID of the two objects:
Even if both instances are initiated with the same value, the comparison for equality will fail:
Applying the deep inspection produces the following misleading result:
With best regards
Peter
The text was updated successfully, but these errors were encountered: