Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid fataling on StrictMock(template=str).garbage
Summary: Accessing nonexistent attributes of `StrictMock`s templated on `str` causes fatals. This is because of an unfortunate self-reference, where when a `UndefinedAttribute` or `AttributeError` is thrown, it tries to include `f"{self}"`, which invokes `self.__format__`, which hits the attribute handling, which triggers another UndefinedAttribute... The solution is just to directly point those prints to `repr(self`)`, which works. Reviewed By: deathowl Differential Revision: D30966913 fbshipit-source-id: fd84a5ac256b9010acb676a32c6b9b4f8bba7fe0
- Loading branch information
1 parent
a4ec5c6
commit 013b319
Showing
2 changed files
with
14 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