Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
...i.e. the code that's used to display the difference between the actual and expected values for most of the `assert[...]` methods of `TestCase` when the assertion fails. This will be used to better display the diffs on the admin history page in upcoming commit(s) - with some modifications. The code was copied from https://github.com/python/cpython/blob/v3.12.0/Lib/unittest/util.py#L8-L52, with the following changes: * Placed the code inside a class, to group the functions and their "setting" variables from other code - which also lets them easily be overridden by users * Removed the `_` prefix from the functions and variables * Added type hints * Formatted with Black Lastly, the code was copied instead of simply imported from `unittest`, because the functions are undocumented and underscore-prefixed, which means that they're prone to being changed (drastically) or even removed, and so I think maintaining it will be easier and more stable by copy-pasting it - which additionally facilitates modification.
- Loading branch information