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()
def setUp(self): cleanup()
def tearDown(self): cleanup(self.unittest_dir)
# 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()
def tearDown(self) -> None: """Post-test actions.""" os.chdir('..') cleanup(self.unit_test_dir)
def tearDown(self) -> None: """Post-test actions.""" cleanup(self.unit_test_dir)
def tearDown(self) -> None: """Post-test actions.""" time.sleep = self.o_sleep cleanup(self.unit_test_dir)
def tearDown(self) -> None: """Post-test actions.""" tear_queues(self.queues) cleanup(self.unit_test_dir)
def tearDown(self): """Post-test actions.""" cleanup(self.unit_test_dir) tear_queues(self.queues)
def tearDown(self): """Post-test actions.""" cleanup(self.unit_test_dir) with ignored(OSError): os.remove('Receiver - Plaintext log (None)')
def tearDown(self): cleanup(self.unittest_dir) tear_queues(self.queues)