diff options
| author | Victor Stinner <victor.stinner@gmail.com> | 2014-12-26 21:16:17 +0100 |
|---|---|---|
| committer | Victor Stinner <victor.stinner@gmail.com> | 2014-12-26 21:16:17 +0100 |
| commit | 1385ab70894cd9bafa480d7b7eed82240cd02749 (patch) | |
| tree | a5fa43e4679c3a26fff12f150d25d5666a809f73 /tests/test_tasks.py | |
| parent | 5d9276ffb0ac4eba272080821790edf975cbc1f1 (diff) | |
| download | trollius-git-1385ab70894cd9bafa480d7b7eed82240cd02749.tar.gz | |
CPython doesn't have asyncio.test_support
Diffstat (limited to 'tests/test_tasks.py')
| -rw-r--r-- | tests/test_tasks.py | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/tests/test_tasks.py b/tests/test_tasks.py index c005366..1520fb4 100644 --- a/tests/test_tasks.py +++ b/tests/test_tasks.py @@ -10,8 +10,13 @@ from unittest import mock import asyncio from asyncio import coroutines -from asyncio import test_support as support from asyncio import test_utils +try: + from test import support + from test.script_helper import assert_python_ok +except ImportError: + from asyncio import test_support as support + from asyncio.test_support import assert_python_ok PY34 = (sys.version_info >= (3, 4)) @@ -1776,23 +1781,23 @@ class GatherTestsBase: # Test with -E to not fail if the unit test was run with # PYTHONASYNCIODEBUG set to a non-empty string - sts, stdout, stderr = support.assert_python_ok('-E', '-c', code, - PYTHONPATH=aio_path) + sts, stdout, stderr = assert_python_ok('-E', '-c', code, + PYTHONPATH=aio_path) self.assertEqual(stdout.rstrip(), b'False') - sts, stdout, stderr = support.assert_python_ok('-c', code, - PYTHONASYNCIODEBUG='', - PYTHONPATH=aio_path) + sts, stdout, stderr = assert_python_ok('-c', code, + PYTHONASYNCIODEBUG='', + PYTHONPATH=aio_path) self.assertEqual(stdout.rstrip(), b'False') - sts, stdout, stderr = support.assert_python_ok('-c', code, - PYTHONASYNCIODEBUG='1', - PYTHONPATH=aio_path) + sts, stdout, stderr = assert_python_ok('-c', code, + PYTHONASYNCIODEBUG='1', + PYTHONPATH=aio_path) self.assertEqual(stdout.rstrip(), b'True') - sts, stdout, stderr = support.assert_python_ok('-E', '-c', code, - PYTHONASYNCIODEBUG='1', - PYTHONPATH=aio_path) + sts, stdout, stderr = assert_python_ok('-E', '-c', code, + PYTHONASYNCIODEBUG='1', + PYTHONPATH=aio_path) self.assertEqual(stdout.rstrip(), b'False') |
