MCPcopy Index your code
hub / github.com/python/cpython / run_testbed

Function run_testbed

Android/android.py:705–737  ·  view source on GitHub ↗
(context)

Source from the content-addressed store, hash-verified

703
704
705async def run_testbed(context):
706 setup_ci()
707 setup_sdk()
708 setup_testbed()
709
710 if context.managed:
711 # In this mode, Gradle will create a device with an unpredictable name.
712 # So we save a list of the running devices before starting Gradle, and
713 # find_device then waits for a new device to appear.
714 initial_devices = await list_devices()
715 else:
716 # In case the previous shutdown was unclean, make sure the app isn't
717 # running, otherwise we might show logs from a previous run. This is
718 # unnecessary in --managed mode, because Gradle creates a new emulator
719 # every time.
720 stop_app(context.connected)
721 initial_devices = None
722
723 try:
724 async with asyncio.TaskGroup() as tg:
725 tg.create_task(logcat_task(context, initial_devices))
726 tg.create_task(gradle_task(context))
727 except* MySystemExit as e:
728 raise SystemExit(*e.exceptions[0].args) from None
729 except* CalledProcessError as e:
730 # If Python produced no output, then the user probably wants to see the
731 # verbose output to explain why the test failed.
732 if not python_started:
733 for stream, line in hidden_output:
734 stream.write(line)
735
736 # Extract it from the ExceptionGroup so it can be handled by `main`.
737 raise e.exceptions[0]
738
739
740def package_version(prefix_dir):

Callers

nothing calls this directly

Calls 9

setup_ciFunction · 0.85
setup_sdkFunction · 0.85
setup_testbedFunction · 0.85
list_devicesFunction · 0.85
stop_appFunction · 0.85
logcat_taskFunction · 0.85
gradle_taskFunction · 0.85
create_taskMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…