Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
parser = argparse.ArgumentParser(add_help=False)
parser.add_argument("--no-buffer", action="store_true")
parser.add_argument("--no-pause", action="store_true")
args, unparsed_args = parser.parse_known_args()
sys.argv[1:] = unparsed_args
# By default, pause before exiting
if not args.no_pause:
atexit.register(lambda: not multiprocessing.current_process().name.startswith("PoolWorker-") and
raw_input("Press Enter to exit ..."))
print("Testing", full_version() + "\n")
# Additional setup normally done by green.cmdline.main()
if has_green:
green_args = green.config.parseArguments()
green_args = green.config.mergeConfig(green_args)
if green_args.shouldExit:
sys.exit(green_args.exitCode)
green.suite.GreenTestSuite.args = green_args
if green_args.debug:
green.output.debug_level = green_args.debug
total_tests = total_skipped = total_failures = total_errors = total_passing = 0
def accumulate_results(r):
global total_tests, total_skipped, total_failures, total_errors, total_passing
total_tests += r.testsRun
total_skipped += len(r.skipped)
total_failures += len(r.failures)
total_errors += len(r.errors)
if has_green:
total_passing += len(r.passing)
parser.add_argument("--no-buffer", action="store_true")
parser.add_argument("--no-pause", action="store_true")
args, unparsed_args = parser.parse_known_args()
sys.argv[1:] = unparsed_args
# By default, pause before exiting
if not args.no_pause:
atexit.register(lambda: not multiprocessing.current_process().name.startswith("PoolWorker-") and
raw_input("Press Enter to exit ..."))
print("Testing", full_version() + "\n")
# Additional setup normally done by green.cmdline.main()
if has_green:
green_args = green.config.parseArguments()
green_args = green.config.mergeConfig(green_args)
if green_args.shouldExit:
sys.exit(green_args.exitCode)
green.suite.GreenTestSuite.args = green_args
if green_args.debug:
green.output.debug_level = green_args.debug
total_tests = total_skipped = total_failures = total_errors = total_passing = 0
def accumulate_results(r):
global total_tests, total_skipped, total_failures, total_errors, total_passing
total_tests += r.testsRun
total_skipped += len(r.skipped)
total_failures += len(r.failures)
total_errors += len(r.errors)
if has_green:
total_passing += len(r.passing)
def main(argv=None, testing=False):
args = config.parseArguments(argv)
args = config.mergeConfig(args, testing)
if args.shouldExit:
return args.exitCode
# Clear out all the passed-in-options just in case someone tries to run a
# test that assumes sys.argv is clean. I can't guess at the script name
# that they want, though, so we'll just leave ours.
sys.argv = sys.argv[:1]
# Set up our various main objects
from green.loader import GreenTestLoader, getCompletions
from green.runner import run
from green.output import GreenStream, debug
import green.output
from green.suite import GreenTestSuite
def main(argv=None, testing=False):
args = config.parseArguments(argv)
args = config.mergeConfig(args, testing)
if args.shouldExit:
return args.exitCode
# Clear out all the passed-in-options just in case someone tries to run a
# test that assumes sys.argv is clean. I can't guess at the script name
# that they want, though, so we'll just leave ours.
sys.argv = sys.argv[:1]
# Set up our various main objects
from green.loader import GreenTestLoader, getCompletions
from green.runner import run
from green.output import GreenStream, debug
import green.output
from green.suite import GreenTestSuite
GreenTestSuite.args = args