Fix files that do work on import instead of only if __name__ == __main__

@lamblin Good to know, thanks! That means we should use `setUpClass`, not `setUp`.