diff --git a/tests/types/Makefile.am b/tests/types/Makefile.am
--- a/tests/types/Makefile.am
+++ b/tests/types/Makefile.am
@@ -41,4 +41,4 @@
 
 %.typelib: %.gir $(top_builddir)/tools/g-ir-compiler$(EXEEXT) Makefile
 	$(top_builddir)/tools/g-ir-compiler --includedir=. --includedir=$(top_builddir)/gir $< -o $@
-	$(SCANNER) --typelib-xml $< > $<.tmp && mv $<.tmp $<.txml
+	PYTHONPATH=$(top_builddir):$$PYTHONPATH $(SCANNER) --typelib-xml $< > $<.tmp && mv $<.tmp $<.txml
