So I start with the very first pure Python 3 package I find on PyPI (stagger). 3to2 works mostly fine, except for the class decorations used in id3.py: it doesn’t add a newline to the end of the assignment statement that implements the decorations in Python 2 syntax. ”OK”, I thought, “I’ll make a bug report and add a few more test cases to the test suite for fix_classdecorator.” Except there was no test suite for fix_classdecorator.
The initial bug is simple: I forgot to (and/or simply didn’t know that I should) wrap the assignment statement in a simple_stmt with a newline afterwards. But after adding a few test cases (several, actually), it turns out that the fixer wasn’t really doing the language feature much justice: it indiscriminately threw out anything in parentheses (and the parentheses themselves) after the name in the @decorator.
*sigh*