Ejemplo n.º 1
0
def run(test_folder_name, verbosity, exit_on_failure):
  # Build and run the tests in test_folder_name
  tests = build_suite(test_folder_name, verbosity)
  result = unittest.TextTestRunner(verbosity=verbosity).run(tests)
  if exit_on_failure and not result.wasSuccessful():
    sys.exit(1)
  cleanup()
Ejemplo n.º 2
0
 def setUp(self):
     cleanup()
Ejemplo n.º 3
0
 def tearDown(self):
     cleanup(self.unittest_dir)
Ejemplo n.º 4
0
# try to start in a consistent, predictable location
if sys.path[0]: 
    os.chdir(sys.path[0])

# find all of the planet test modules
modules = map(fullmodname, glob.glob(os.path.join('tests', 'test_*.py')))
print "Running the tests found in the following modules:"
print modules

# load all of the tests into a suite
try:
    suite = unittest.TestLoader().loadTestsFromNames(modules)
except Exception, exception:
    # attempt to produce a more specific message
    for module in modules: 
        __import__(module)
    raise

verbosity = 1
if "-q" in sys.argv or '--quiet' in sys.argv:
    verbosity = 0
if "-v" in sys.argv or '--verbose' in sys.argv:
    verbosity = 2

# run test suite
unittest.TextTestRunner(verbosity=verbosity).run(suite)

cleanup()

Ejemplo n.º 5
0
 def tearDown(self) -> None:
     """Post-test actions."""
     os.chdir('..')
     cleanup(self.unit_test_dir)
Ejemplo n.º 6
0
 def tearDown(self) -> None:
     """Post-test actions."""
     cleanup(self.unit_test_dir)
Ejemplo n.º 7
0
 def tearDown(self) -> None:
     """Post-test actions."""
     time.sleep = self.o_sleep
     cleanup(self.unit_test_dir)
Ejemplo n.º 8
0
 def tearDown(self) -> None:
     """Post-test actions."""
     tear_queues(self.queues)
     cleanup(self.unit_test_dir)
Ejemplo n.º 9
0
 def tearDown(self):
     """Post-test actions."""
     cleanup(self.unit_test_dir)
     tear_queues(self.queues)
Ejemplo n.º 10
0
 def tearDown(self):
     """Post-test actions."""
     cleanup(self.unit_test_dir)
     with ignored(OSError):
         os.remove('Receiver - Plaintext log (None)')
Ejemplo n.º 11
0
 def tearDown(self):
     cleanup(self.unittest_dir)
     tear_queues(self.queues)