diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2014-09-25 19:09:54 -0400 |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2014-09-25 19:09:54 -0400 |
commit | f3e29d20c153e4e5a468968aea204b1b1c15770a (patch) | |
tree | 2656a34547de48225d59ea638d504691573d1f3c | |
parent | 0dfb7bf842b3f730722c341bd1b0851637c0a313 (diff) | |
download | trollius-git-f3e29d20c153e4e5a468968aea204b1b1c15770a.tar.gz |
test_tasks: Fix test_env_var_debug to use correct asyncio module (issue #207)
-rw-r--r-- | tests/test_tasks.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/test_tasks.py b/tests/test_tasks.py index e25aa4d..770f218 100644 --- a/tests/test_tasks.py +++ b/tests/test_tasks.py @@ -1,5 +1,6 @@ """Tests for tasks.py.""" +import os import re import sys import types @@ -1768,25 +1769,31 @@ class GatherTestsBase: self.assertEqual(fut.result(), [3, 1, exc, exc2]) def test_env_var_debug(self): + aio_path = os.path.dirname(os.path.dirname(asyncio.__file__)) + code = '\n'.join(( 'import asyncio.coroutines', 'print(asyncio.coroutines._DEBUG)')) # Test with -E to not fail if the unit test was run with # PYTHONASYNCIODEBUG set to a non-empty string - sts, stdout, stderr = assert_python_ok('-E', '-c', code) + sts, stdout, stderr = assert_python_ok('-E', '-c', code, + PYTHONPATH=aio_path) self.assertEqual(stdout.rstrip(), b'False') sts, stdout, stderr = assert_python_ok('-c', code, - PYTHONASYNCIODEBUG='') + PYTHONASYNCIODEBUG='', + PYTHONPATH=aio_path) self.assertEqual(stdout.rstrip(), b'False') sts, stdout, stderr = assert_python_ok('-c', code, - PYTHONASYNCIODEBUG='1') + PYTHONASYNCIODEBUG='1', + PYTHONPATH=aio_path) self.assertEqual(stdout.rstrip(), b'True') sts, stdout, stderr = assert_python_ok('-E', '-c', code, - PYTHONASYNCIODEBUG='1') + PYTHONASYNCIODEBUG='1', + PYTHONPATH=aio_path) self.assertEqual(stdout.rstrip(), b'False') |