rm -rf "${abs_builddir}"/testing`rpm --eval '%_dbpath'`/*
]])
-m4_define([RPMPY_RUN],[
+m4_define([RPMPY_RUN],[[
cat << EOF > test.py
import rpm, sys
dbpath=rpm.expandMacro('%_dbpath')
$1
EOF
python test.py
-])
+]])
m4_define([RPMPY_CHECK],[
+AT_CHECK([RPMPY_RUN([$1])], [], [$2], [$3])
+])
+
+m4_define([RPMPY_TEST],[
AT_SETUP([$1])
AT_KEYWORDS([python])
-AT_CHECK([RPMPY_RUN([[$2]])], [], [$3], [$4])
+RPMDB_CLEAR
+RPMDB_INIT
+RPMPY_CHECK([$2], [$3], [$4])
AT_CLEANUP
])