diff options
author | Nikolay Kim <fafhrd91@gmail.com> | 2013-01-24 20:54:56 -0800 |
---|---|---|
committer | Nikolay Kim <fafhrd91@gmail.com> | 2013-01-24 20:54:56 -0800 |
commit | ad7e6bb443a9c9329b0ca38055aac19256dadc0b (patch) | |
tree | 3130757ff94f6149269c49599d8ee616e905c11e | |
parent | 251e50b65c2a513fc9bceb42af0afbf1e77c1d27 (diff) | |
download | trollius-git-ad7e6bb443a9c9329b0ca38055aac19256dadc0b.tar.gz |
load tests from *_test.py files
-rw-r--r-- | runtests.py | 7 | ||||
-rw-r--r-- | tulip/http_client_test.py | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/runtests.py b/runtests.py index 1eef652..e2598c9 100644 --- a/runtests.py +++ b/runtests.py @@ -15,15 +15,18 @@ e.g. 'tulip.events_test.PolicyTests.testPolicy'. # Originally written by Beech Horn (for NDB). +import os import re import sys import unittest assert sys.version >= '3.3', 'Please use Python 3.3 or higher.' +TULIP_DIR = os.path.join(os.path.dirname(__file__), 'tulip') + + def load_tests(includes=(), excludes=()): - mods = ['events', 'futures', 'tasks'] - test_mods = ['%s_test' % name for name in mods] + test_mods = [f[:-3] for f in os.listdir(TULIP_DIR) if f.endswith('_test.py')] tulip = __import__('tulip', fromlist=test_mods) loader = unittest.TestLoader() diff --git a/tulip/http_client_test.py b/tulip/http_client_test.py index b3e3414..f712da9 100644 --- a/tulip/http_client_test.py +++ b/tulip/http_client_test.py @@ -7,7 +7,7 @@ from . import http_client from . import tasks -class StreamReaderTest(unittest.TestCase): +class StreamReaderTests(unittest.TestCase): DATA = b'line1\nline2\nline3\n' |