Refactor test.compat module
Refactor test.compat module

The refactoring includes reordering of imports, removing unnecessary tags
and handling alternative imports with exceptions rather than
conditional structures.

piotr-rusin/spam-lists