Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix assertRaises when the exception has a metaclass
Due to not taking into account that the type of the class can be a subclass of type (which is the case when using metaclasses), assertRaises would report a false positive in case an exception that was expected had a custom metaclass. This patch introduces a more robust checking if a given object is a class or an instance of one, and adds a test case, to make sure exceptions with custom metaclasses don't break assertRaises.
- Loading branch information
Showing
4 changed files
with
19 additions
and
1 deletion.
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
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