Ejemplo n.º 1
0
 def testIgnores(self):
     """Verify we skip ignored dirs."""
     for f in ('foo', 'bar_unittest'):
         osutils.Touch(os.path.join(self.tempdir, f))
     # Make sure it works first.
     found = run_tests.FindTests(search_paths=(self.tempdir, ))
     self.assertEqual(sorted(found), ['./bar_unittest'])
     # Mark the dir ignored.
     osutils.Touch(os.path.join(self.tempdir, '.testignore'))
     # Make sure we ignore it.
     found = run_tests.FindTests(search_paths=(self.tempdir, ))
     self.assertEqual(list(found), [])
Ejemplo n.º 2
0
 def testSubdirs(self):
     """We should recurse into subdirs."""
     for f in ('bar_unittest', 'somw/dir/a/cow_unittest'):
         osutils.Touch(os.path.join(self.tempdir, f), makedirs=True)
     found = run_tests.FindTests(search_paths=(self.tempdir, ))
     self.assertEqual(sorted(found),
                      ['./bar_unittest', 'somw/dir/a/cow_unittest'])
Ejemplo n.º 3
0
 def testNames(self):
     """We only look for *_unittest."""
     for f in ('foo', 'foo_unittests', 'bar_unittest', 'cow_unittest'):
         osutils.Touch(os.path.join(self.tempdir, f))
     found = run_tests.FindTests(search_paths=(self.tempdir, ))
     self.assertEqual(sorted(found), ['./bar_unittest', './cow_unittest'])