summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Chauvat <nicolas.chauvat@logilab.fr>2006-08-13 17:53:27 +0200
committerNicolas Chauvat <nicolas.chauvat@logilab.fr>2006-08-13 17:53:27 +0200
commiteaf2b4196e6b4445c27f2d7cf28471e8388e5b01 (patch)
treede075fc16e9aa064c5f91616df6518a87fb656f9
parent4d2ae05f2b7692f6cab75b81827e9184c8dc1e7d (diff)
downloadlogilab-common-eaf2b4196e6b4445c27f2d7cf28471e8388e5b01.tar.gz
add command pytest that will find and run project's tests
-rwxr-xr-xbin/pytest15
1 files changed, 15 insertions, 0 deletions
diff --git a/bin/pytest b/bin/pytest
new file mode 100755
index 0000000..139872b
--- /dev/null
+++ b/bin/pytest
@@ -0,0 +1,15 @@
+#!/usr/bin/python
+
+import os, sys
+import os.path as osp
+from logilab.common import testlib
+
+curdir = os.getcwd()
+if osp.exists(osp.join(curdir, '__pkginfo__.py')):
+ projdir = osp.abspath(curdir)
+elif osp.exists(osp.join(curdir, '..')):
+ projdir = osp.abspath(osp.join(curdir, '..'))
+else:
+ print 'fixme: cannot be run from here.'
+ sys.exit(1)
+testlib.main(osp.join(projdir,'test'))