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.

This commit is contained in:
Dave Halter
2015-04-09 16:17:16 +02:00
parent 1195ed64ea
commit a9d3df9b5e
2 changed files with 14 additions and 14 deletions

View File

@@ -8,8 +8,8 @@ def sphinxy(a, b, c, d, x):
:param a: blablabla :param a: blablabla
:type a: str :type a: str
:type b: (str, int) :type b: (str, int)
:type c: threading.Thread :type c: random.Random
:type d: :class:`threading.Thread` :type d: :class:`random.Random`
:param str x: blablabla :param str x: blablabla
:rtype: dict :rtype: dict
""" """
@@ -19,10 +19,10 @@ def sphinxy(a, b, c, d, x):
b[0] b[0]
#? int() #? int()
b[1] b[1]
#? ['join'] #? ['seed']
c.join c.seed
#? ['join'] #? ['seed']
d.join d.seed
#? ['lower'] #? ['lower']
x.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. 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'] #? ['seed']
lst[0].start lst[0].seed
import collections as col import collections as col
# use some weird index # use some weird index
@@ -94,11 +94,11 @@ def two_dots(a):
# sphinx returns # sphinx returns
def return_module_object(): def return_module_object():
""" """
:rtype: :class:`threading.Thread` :rtype: :class:`random.Random`
""" """
#? ['join'] #? ['seed']
return_module_object().join return_module_object().seed
# ----------------- # -----------------

View File

@@ -51,11 +51,11 @@ class TestDocstring(unittest.TestCase):
s = """ s = """
def func(arg): def func(arg):
''' '''
:type arg: threading.Thread :type arg: random.Random
''' '''
arg.""" arg."""
names = [c.name for c in jedi.Script(s).completions()] names = [c.name for c in jedi.Script(s).completions()]
assert 'start' in names assert 'seed' in names
def test_docstrings_param_type(self): def test_docstrings_param_type(self):
s = """ s = """