django-planet
April 25, 2024

Python: Diffing unit tests to keep a copy-pasted code in sync

published by Adam Johnson
in blog Adam Johnson
original entry Python: Diffing unit tests to keep a copy-pasted code in sync

Copy-paste-tweaking library code feels like a dirty but inevitable programming practice. Often driven by deadlines or other constraints, it seems all projects end up with something copy-pasted in and tweaked for one specific use case.

When we find ourselves doing this, it’s essential to consider the long-term maintenance of …