summaryrefslogtreecommitdiff
path: root/pytest.py
diff options
context:
space:
mode:
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>2007-07-30 12:14:23 +0200
committerAdrien Di Mascio <Adrien.DiMascio@logilab.fr>2007-07-30 12:14:23 +0200
commitaf2fa2e6fd507efefb8a6b368b79c8725ecc1bd5 (patch)
tree0a5637f939ea4d9638b6985fa4401394e672eaaa /pytest.py
parent6854f5c3dcd3b3cdbad0145bc8b1eb923727667f (diff)
downloadlogilab-common-af2fa2e6fd507efefb8a6b368b79c8725ecc1bd5.tar.gz
restored testonedir() method on PyTester
Diffstat (limited to 'pytest.py')
-rw-r--r--pytest.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/pytest.py b/pytest.py
index 9fa82bc..273c67e 100644
--- a/pytest.py
+++ b/pytest.py
@@ -242,6 +242,17 @@ class PyTester(object):
self.testonedir(dirname, exitfirst)
dirs[:] = []
+
+ def testonedir(self, testdir, exitfirst=False):
+ """finds each testfile in the `testdir` and runs it"""
+ for filename in abspath_listdir(testdir):
+ if this_is_a_testfile(filename):
+ # run test and collect information
+ prog = self.testfile(filename, batchmode=True)
+ if exitfirst and (prog is None or not prog.result.wasSuccessful()):
+ break
+ # clean local modules
+ remove_local_modules_from_sys(testdir)
def testfile(self, filename, batchmode=False):