Index: tests/Makefile.am
===================================================================
--- tests/Makefile.am	(revision 657c36f3c9f3d2305e3794bd51879f2c4e32ed1a)
+++ tests/Makefile.am	(revision 0783909f9e381eb4f8595e3b75a55e1140068e98)
@@ -103,9 +103,9 @@
 
 mostlyclean-local :
+	find ${builddir} -not -path './__pycache__/*' -path '*.o' -delete
+	find ${builddir} -not -path './__pycache__/*' -path '*/.err/*.log' -delete
+	find ${builddir} -not -path './__pycache__/*' -path '*/.out/*.log' -delete
 	rm -f ${EXTRA_PROGRAMS}
 	rm -rf __pycache__
-	find ${builddir} -path '*.o' -delete
-	find ${builddir} -path '*/.err/*.log' -delete
-	find ${builddir} -path '*/.out/*.log' -delete
 
 distclean-local :
