The function pywikibot.showDiff is an important part of the pywikibot UI, allowing users to quickly review proposed changes to be made. It uses color to maximise the amount of information that can be shown to the user on a text interface to help them make their decision.
The logic behind this function was migrated to pywikibot.diff.PatchManager and radically improved , and the switch to using PatchManager occurred in ce6e10ba.
However the module pywikibot.diff only has tests in diff_tests for T134341 (3c8c5eae24a14)
Some very basic tests should be created. There are a lot of interesting test scenarios on https://test.wikipedia.org/wiki/User:John_Vandenberg/diff_test (see T130572 for how to use it)
See documentation in tests/README.rst.
Then it is easier to add new tests when bugs are being fixed (e.g. T130572) and enhancements are added.
This should be an good first task task for a newbie.