diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-11-19 23:17:56 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-11-19 23:17:56 +0100 |
commit | fc90935a5e1f243a95c401c228cded77cdb9d064 (patch) | |
tree | 5d744b51dd0f769e0a8bd54034b1f98e2dcaf296 | |
parent | edf89877523352574f74c9076bc8de752d6e8507 (diff) | |
download | aioeventlet-fc90935a5e1f243a95c401c228cded77cdb9d064.tar.gz |
runtests.py: add --monkey-patch/-m command line option
-rwxr-xr-x | runtests.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/runtests.py b/runtests.py index e93eec3..fe2651b 100755 --- a/runtests.py +++ b/runtests.py @@ -61,6 +61,9 @@ ARGS.add_option( '-c', '--catch', action="store_true", default=False, dest='catchbreak', help='Catch control-C and display results') ARGS.add_option( + '-m', '--monkey-patch', action="store_true", default=False, + dest='monkey_patch', help='Enable eventlet monkey patching') +ARGS.add_option( '--forever', action="store_true", dest='forever', default=False, help='run tests forever to catch sporadic errors') ARGS.add_option( @@ -255,6 +258,11 @@ def runtests(): findleaks = args.findleaks runner_factory = TestRunner if findleaks else unittest.TextTestRunner + if args.monkey_patch: + print("Enable eventlet monkey patching of the Python standard library") + import eventlet + eventlet.monkey_patch() + if args.coverage: cov = coverage.coverage(branch=True, source=['asyncio'], @@ -287,6 +295,7 @@ def runtests(): print("Run tests in debug mode") else: print("Run tests in release mode") + sys.stdout.flush() try: if args.forever: while True: |