diff --git a/src/python/grpcio_tests/commands.py b/src/python/grpcio_tests/commands.py index 7e39200d3d8..436ca4d3c7a 100644 --- a/src/python/grpcio_tests/commands.py +++ b/src/python/grpcio_tests/commands.py @@ -20,7 +20,6 @@ import os.path import platform import re import shutil -import subprocess import sys import setuptools @@ -127,6 +126,9 @@ class TestAio(setuptools.Command): import tests loader = tests.Loader() loader.loadTestsFromNames(['tests_aio']) + # Even without dedicated threads, the framework will somehow spawn a + # new thread for tests to run upon. New thread doesn't have event loop + # attached by default, so initialization is needed. runner = tests.Runner(dedicated_threads=False) result = runner.run(loader.suite) if not result.wasSuccessful(): diff --git a/src/python/grpcio_tests/tests/_runner.py b/src/python/grpcio_tests/tests/_runner.py index 361e99e5f8b..6411ffa8981 100644 --- a/src/python/grpcio_tests/tests/_runner.py +++ b/src/python/grpcio_tests/tests/_runner.py @@ -119,7 +119,7 @@ class Runner(object): def __init__(self, dedicated_threads=True): """Constructs the Runner object. - + Args: dedicated_threads: A bool indicates whether to spawn each unit test in separate thread or not.