[pypy-svn] pypy default: Modify 'test_all.py' to refuse to run if started naively, i.e. in

arigo commits-noreply at bitbucket.org
Mon Feb 14 14:06:14 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r41901:32f5cd9226de
Date: 2011-02-14 14:06 +0100
http://bitbucket.org/pypy/pypy/changeset/32f5cd9226de/

Log:	Modify 'test_all.py' to refuse to run if started naively, i.e. in
	the top directory and with no option. Instead it prints some
	minimal help.

diff --git a/pypy/test_all.py b/pypy/test_all.py
--- a/pypy/test_all.py
+++ b/pypy/test_all.py
@@ -1,4 +1,18 @@
 #! /usr/bin/env python
+"""
+PyPy Test runner interface
+--------------------------
+
+Running test_all.py is equivalent to running py.test
+(either installed from the py lib package, or from ../py/bin/).
+
+For more information, use test_all.py -h.
+"""
+import sys, os
+
+if len(sys.argv) == 1 and os.path.dirname(sys.argv[0]) in '.':
+    print >> sys.stderr, __doc__
+    sys.exit(2)
 
 if __name__ == '__main__':
     import tool.autopath


More information about the Pypy-commit mailing list