-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: simplify bound method representation (#12492)
Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com> Co-authored-by: Farbod Ahmadian <farbod@datachef.com>
- Loading branch information
1 parent
9947ec3
commit 34e2829
Showing
5 changed files
with
71 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
The readability of assertion introspection of bound methods has been enhanced | ||
-- by :user:`farbodahm`, :user:`webknjaz`, :user:`obestwalter`, :user:`flub` | ||
and :user:`glyphack`. | ||
|
||
Earlier, it was like: | ||
|
||
.. code-block:: console | ||
=================================== FAILURES =================================== | ||
_____________________________________ test _____________________________________ | ||
def test(): | ||
> assert Help().fun() == 2 | ||
E assert 1 == 2 | ||
E + where 1 = <bound method Help.fun of <example.Help instance at 0x256a830>>() | ||
E + where <bound method Help.fun of <example.Help instance at 0x256a830>> = <example.Help instance at 0x256a830>.fun | ||
E + where <example.Help instance at 0x256a830> = Help() | ||
example.py:7: AssertionError | ||
=========================== 1 failed in 0.03 seconds =========================== | ||
And now it's like: | ||
|
||
.. code-block:: console | ||
=================================== FAILURES =================================== | ||
_____________________________________ test _____________________________________ | ||
def test(): | ||
> assert Help().fun() == 2 | ||
E assert 1 == 2 | ||
E + where 1 = fun() | ||
E + where fun = <test_local.Help object at 0x1074be230>.fun | ||
E + where <test_local.Help object at 0x1074be230> = Help() | ||
test_local.py:13: AssertionError | ||
=========================== 1 failed in 0.03 seconds =========================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters