From a9d3df9b5e304330a3ec85442fec0f07b283620f Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Thu, 9 Apr 2015 16:17:16 +0200 Subject: [PATCH] Replace the threading.Thread tests in docstrings with random.Random tests, because that might work smother in the travis tests. Don't know why it broke there. --- test/completion/docstring.py | 24 ++++++++++++------------ test/test_evaluate/test_docstring.py | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/test/completion/docstring.py b/test/completion/docstring.py index 5c0e2a99..74667191 100644 --- a/test/completion/docstring.py +++ b/test/completion/docstring.py @@ -8,8 +8,8 @@ def sphinxy(a, b, c, d, x): :param a: blablabla :type a: str :type b: (str, int) - :type c: threading.Thread - :type d: :class:`threading.Thread` + :type c: random.Random + :type d: :class:`random.Random` :param str x: blablabla :rtype: dict """ @@ -19,10 +19,10 @@ def sphinxy(a, b, c, d, x): b[0] #? int() b[1] - #? ['join'] - c.join - #? ['join'] - d.join + #? ['seed'] + c.seed + #? ['seed'] + d.seed #? ['lower'] x.lower @@ -72,10 +72,10 @@ def list_with_non_imports(lst): """ Should be able to work with tuples and lists and still import stuff. - :type lst: (threading.Thread, [collections.defaultdict, ...]) + :type lst: (random.Random, [collections.defaultdict, ...]) """ - #? ['start'] - lst[0].start + #? ['seed'] + lst[0].seed import collections as col # use some weird index @@ -94,11 +94,11 @@ def two_dots(a): # sphinx returns def return_module_object(): """ - :rtype: :class:`threading.Thread` + :rtype: :class:`random.Random` """ -#? ['join'] -return_module_object().join +#? ['seed'] +return_module_object().seed # ----------------- diff --git a/test/test_evaluate/test_docstring.py b/test/test_evaluate/test_docstring.py index 341e2c6d..6dbd1cac 100644 --- a/test/test_evaluate/test_docstring.py +++ b/test/test_evaluate/test_docstring.py @@ -51,11 +51,11 @@ class TestDocstring(unittest.TestCase): s = """ def func(arg): ''' - :type arg: threading.Thread + :type arg: random.Random ''' arg.""" names = [c.name for c in jedi.Script(s).completions()] - assert 'start' in names + assert 'seed' in names def test_docstrings_param_type(self): s = """