diff options
author | Adrien Di Mascio <Adrien.DiMascio@logilab.fr> | 2007-07-30 12:14:23 +0200 |
---|---|---|
committer | Adrien Di Mascio <Adrien.DiMascio@logilab.fr> | 2007-07-30 12:14:23 +0200 |
commit | af2fa2e6fd507efefb8a6b368b79c8725ecc1bd5 (patch) | |
tree | 0a5637f939ea4d9638b6985fa4401394e672eaaa /pytest.py | |
parent | 6854f5c3dcd3b3cdbad0145bc8b1eb923727667f (diff) | |
download | logilab-common-af2fa2e6fd507efefb8a6b368b79c8725ecc1bd5.tar.gz |
restored testonedir() method on PyTester
Diffstat (limited to 'pytest.py')
-rw-r--r-- | pytest.py | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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): |