-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Documentation: misleading deep inspection #411
Copy link
Copy link
Closed
Labels
good first issueeasy issue that is friendly to new contributoreasy issue that is friendly to new contributortype: docsdocumentation improvement, missing or needing clarificationdocumentation improvement, missing or needing clarificationtype: enhancementnew feature or API change, should be merged into features branchnew feature or API change, should be merged into features branch
Metadata
Metadata
Assignees
Labels
good first issueeasy issue that is friendly to new contributoreasy issue that is friendly to new contributortype: docsdocumentation improvement, missing or needing clarificationdocumentation improvement, missing or needing clarificationtype: enhancementnew feature or API change, should be merged into features branchnew 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