diff --git a/tests/test-check-pyflakes.t b/tests/test-check-pyflakes.t
index 86b5bce143e8074840bf790a3bac23b7d11b4dfd_dGVzdHMvdGVzdC1jaGVjay1weWZsYWtlcy50..37e91b54482f8292273556bf9d1b27921774a4e4_dGVzdHMvdGVzdC1jaGVjay1weWZsYWtlcy50 100644
--- a/tests/test-check-pyflakes.t
+++ b/tests/test-check-pyflakes.t
@@ -1,5 +1,7 @@
 #require test-repo pyflakes hg10
 
+Load commonly used test logic
+  $ . "$TESTDIR/testutil"
   $ . "$TESTDIR/helpers-testrepo.sh"
 
 run pyflakes on all tracked files ending in .py or without a file ending
@@ -13,7 +15,5 @@
   [1]
   $ cd "`dirname "$TESTDIR"`"
 
-  $ testrepohg locate 'set:**.py or grep("^#!.*python")' \
-  > -X tests/ \
-  > 2>/dev/null \
+  $ testrepohg files -I 'relglob:*.py' -I 'grep("^#!.*python*")' -X tests \
   > | xargs $PYTHON -m pyflakes 2>/dev/null