Пример #1
0
 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)
Пример #2
0
 def testonedir(self, testdir, exitfirst=False):
     """finds each testfile in the `testdir` and runs it"""
     # special django behaviour : if tests are splited in several files,
     # remove the main tests.py file and tests each test file separately
     testfiles = [fpath for fpath in abspath_listdir(testdir) if this_is_a_testfile(fpath)]
     if len(testfiles) > 1:
         try:
             testfiles.remove(osp.join(testdir, "tests.py"))
         except ValueError:
             pass
     for filename in testfiles:
         # 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)
Пример #3
0
 def testonedir(self, testdir, exitfirst=False):
     """finds each testfile in the `testdir` and runs it"""
     # special django behaviour : if tests are splited in several files,
     # remove the main tests.py file and tests each test file separately
     testfiles = [fpath for fpath in abspath_listdir(testdir)
                  if this_is_a_testfile(fpath)]
     if len(testfiles) > 1:
         try:
             testfiles.remove(osp.join(testdir, 'tests.py'))
         except ValueError:
             pass
     for filename in testfiles:
         # 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)