[py-dev] py lib tests fail in Pybots buildbot
Grig Gheorghiu
grig at agilistas.org
Thu Oct 26 23:20:33 CEST 2006
Noticed some new failures.
Full log for build step with Python trunk binary:
http://www.python.org/dev/buildbot/community/all/x86%20Ubuntu%20Breezy%20trunk/builds/63/step-py.lib/0
Full log for build step with Python 2.5 binary:
http://www.python.org/dev/buildbot/community/all/x86%20Ubuntu%20Breezy%202.5/builds/33/step-py.lib/0
Here are the errors from the 2.5 build step:
_________________ entrypoint: TestRest().test_class_typedefs __________________
def test_class_typedefs(self):
class A(object):
def __init__(self, x):
pass
class B(object):
def __init__(self, y):
pass
def xxx(x):
return x
descs = {'A':A, 'B':B, 'xxx':xxx}
ds = DocStorage().from_dict(descs)
t = Tracer(ds)
t.start_tracing()
xxx(A(3))
xxx(B("f"))
t.end_tracing()
lg = DirectPaste()
tempdir = temppath.ensure("classargs", dir=True)
r = RestGen(ds, lg, DirWriter(tempdir))
> r.write()
[/tmp/pylib/py/apigen/rest/testing/test_rest.py:285]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def write(self):
"""write the data to the writer"""
# note that this builds up a list of Rest elements for the index as
# 'side effect', the list is passed along and filled, while the actual
# sections (also ReST elements) are returned by the write_* methods
# XXX this is quite icky! would be nice to have refactored
indexlst = [Title("Module: %s" % self.dsa.get_module_name(),
belowchar="="),
Paragraph(self.dsa.get_module_info()),
Title("Exported functions:", belowchar="-")]
funclst = self.write_function_list(indexlst)
indexlst.append(Title("Exported classes:", belowchar="-"))
> classlst = self.write_class_list(indexlst)
[/tmp/pylib/py/apigen/rest/genrest.py:128]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def write_class_list(self, indexlst):
retlst = []
for name in self.dsa.get_class_names():
sectionname = 'class_%s' % (name,)
linktarget = self.writer.getlink('class', name, sectionname)
indexlst.append(ListItem(Text("Class: "), Link(name, linktarget)))
> retlst.append((sectionname, self.write_class(sectionname, name)))
[/tmp/pylib/py/apigen/rest/genrest.py:157]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def write_class(self, section_name, class_name):
classlst = [Title("Class: %s" % class_name, belowchar='-'),
LiteralBlock(self.dsa.get_function_doc(class_name))]
# write down exported methods
classlst.append(Title("Exported methods:", belowchar="^"))
funclist = []
for method in self.dsa.get_class_methods(class_name):
sectionname = 'method_%s_%s' % (class_name, method)
linktext = '%s.%s' % (class_name, method)
linktarget = self.writer.getlink('function', linktext,
sectionname)
classlst.append(ListItem(Link(linktext, linktarget)))
# XXX assuming a function is always part of a class section
funclist.append((sectionname,
self.write_function(sectionname,
class_name + "." + method,
> '^')))
[/tmp/pylib/py/apigen/rest/genrest.py:177]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def write_function(self, section_name, fun_name, belowchar='-'):
# XXX I think the docstring should either be split on \n\n and cleaned
# from indentation, or treated as ReST too (although this is obviously
# dangerous for non-ReST docstrings)...
lst = [Title("Function: %s" % fun_name, belowchar=belowchar),
LiteralBlock(self.dsa.get_function_doc(fun_name)),
LiteralBlock(self.dsa.get_function_definition(fun_name))]
args, retval = self.dsa.get_function_signature(fun_name)
arg_str = "\n".join(["%s :: %s" % (str(name), str(type)) for
name, type in args])
arg_str += "\n" + "Return value :: %s" % str(retval)
lst.append(Paragraph("where:"))
lst.append(LiteralBlock(arg_str))
# XXX missing implementation of dsa.get_function_location()
#filename, lineno = self.dsa.get_function_location(fun_name)
#linkname, linktarget = self.linkgen.getlink(filename, lineno)
#if linktarget:
# lst.append(Paragraph("Function source: ",
# Link(linkname, linktarget)))
#else:
lst.append(Paragraph('Function source:'))
> lst.append(LiteralBlock(self.dsa.get_function_source(fun_name)))
[/tmp/pylib/py/apigen/rest/genrest.py:203]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def get_function_source(self, name):
desc = self.ds.descs[name]
try:
> return str(py.code.Source(desc.pyobj))
[/tmp/pylib/py/apigen/tracer/docstorage.py:196]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def __init__(self, *parts, **kwargs):
self.lines = lines = []
de = kwargs.get('deindent', True)
rstrip = kwargs.get('rstrip', True)
for part in parts:
if not part:
partlines = []
if isinstance(part, Source):
partlines = part.lines
elif isinstance(part, (unicode, str)):
partlines = part.split('\n')
if rstrip:
while partlines:
if partlines[-1].strip():
break
partlines.pop()
else:
> partlines = getsource(part, deindent=de).lines
[/tmp/pylib/py/code/source.py:30]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def getsource(obj, **kwargs):
if hasattr(obj, 'func_code'):
obj = obj.func_code
elif hasattr(obj, 'f_code'):
obj = obj.f_code
try:
fullsource = obj.co_filename.__source__
except AttributeError:
> strsrc = inspect.getsource(obj)
[/tmp/pylib/py/code/source.py:231]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def getsource(object):
"""Return the text of the source code for an object.
The argument may be a module, class, method, function, traceback, frame,
or code object. The source code is returned as a single string. An
IOError is raised if the source code cannot be retrieved."""
> lines, lnum = getsourcelines(object)
[/usr/lib/python2.4/inspect.py:563]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def getsourcelines(object):
"""Return a list of source lines and starting line number for an object.
The argument may be a module, class, method, function, traceback, frame,
or code object. The source code is returned as a list of the lines
corresponding to the object and the line number indicates where in the
original source file the first line of code was found. An IOError is
raised if the source code cannot be retrieved."""
lines, lnum = findsource(object)
if ismodule(object): return lines, 0
> else: return getblock(lines[lnum:]), lnum + 1
[/usr/lib/python2.4/inspect.py:555]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def getblock(lines):
"""Extract the block of code at the top of the given list of lines."""
try:
> tokenize.tokenize(ListReader(lines).readline, BlockFinder().tokeneater)
[/usr/lib/python2.4/inspect.py:538]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def tokenize(readline, tokeneater=printtoken):
"""
The tokenize() function accepts two parameters: one representing the
input stream, and one providing an output mechanism for tokenize().
The first parameter, readline, must be a callable object which provides
the same interface as the readline() method of built-in file objects.
Each call to the function should return one line of input as a string.
The second parameter, tokeneater, must also be a callable object. It is
called once for each token, with five arguments, corresponding to the
tuples generated by generate_tokens().
"""
try:
> tokenize_loop(readline, tokeneater)
[/usr/lib/python2.4/tokenize.py:153]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def tokenize_loop(readline, tokeneater):
> for token_info in generate_tokens(readline):
[/usr/lib/python2.4/tokenize.py:159]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def generate_tokens(readline):
"""
The generate_tokens() generator requires one argment, readline, which
must be a callable object which provides the same interface as the
readline() method of built-in file objects. Each call to the function
should return one line of input as a string.
The generator produces 5-tuples with these members: the token type; the
token string; a 2-tuple (srow, scol) of ints specifying the row and
column where the token begins in the source; a 2-tuple (erow, ecol) of
ints specifying the row and column where the token ends in the source;
and the line on which the token was found. The line passed is the
logical line; continuation lines are included.
"""
lnum = parenlev = continued = 0
namechars, numchars = string.ascii_letters + '_', '0123456789'
contstr, needcont = '', 0
contline = None
indents = [0]
while 1: # loop over lines in stream
line = readline()
lnum = lnum + 1
pos, max = 0, len(line)
if contstr: # continued string
if not line:
raise TokenError, ("EOF in multi-line string", strstart)
endmatch = endprog.match(line)
if endmatch:
pos = end = endmatch.end(0)
yield (STRING, contstr + line[:end],
strstart, (lnum, end), contline + line)
contstr, needcont = '', 0
contline = None
elif needcont and line[-2:] != '\\\n' and line[-3:] != '\\\r\n':
yield (ERRORTOKEN, contstr + line,
strstart, (lnum, len(line)), contline)
contstr = ''
contline = None
continue
else:
contstr = contstr + line
contline = contline + line
continue
elif parenlev == 0 and not continued: # new statement
if not line: break
column = 0
while pos < max: # measure leading whitespace
if line[pos] == ' ': column = column + 1
elif line[pos] == '\t': column = (column/tabsize +
1)*tabsize
elif line[pos] == '\f': column = 0
else: break
pos = pos + 1
if pos == max: break
if line[pos] in '#\r\n': # skip comments or
blank lines
yield ((NL, COMMENT)[line[pos] == '#'], line[pos:],
(lnum, pos), (lnum, len(line)), line)
continue
if column > indents[-1]: # count indents or dedents
indents.append(column)
yield (INDENT, line[:pos], (lnum, 0), (lnum, pos), line)
while column < indents[-1]:
if column not in indents:
E raise IndentationError(
"unindent does not match any outer
indentation level")
> IndentationError: unindent does not match any outer indentation level
[/usr/lib/python2.4/tokenize.py:229]
_______________________________________________________________________________
______ entrypoint: TestPopenGateway().test_channel_passing_over_channel _______
def test_channel_passing_over_channel(self):
channel = self.gw.remote_exec('''
c = channel.gateway.newchannel()
channel.send(c)
c.send(42)
''')
c = channel.receive()
x = c.receive()
assert x == 42
# check that the both sides previous channels are really gone
channel.waitclose(0.3)
E assert channel.id not in self.gw.channelfactory._channels
> AssertionError: (inconsistently failed then succeeded)
[/tmp/pylib/py/execnet/testing/test_gateway.py:160]
_______________________________________________________________________________
_______________________ entrypoint: test_importall[226] _______________________
def check_import(modpath):
print "checking import", modpath
E assert __import__(modpath)
> ImportError: No module named package.submodule.__init__
[/tmp/pylib/py/misc/testing/test_initpkg.py:67]
- - - - - - - - - - - - - [226]: recorded stdout - - - - - - - - - - - - - -
checking import py.__.apigen.tracer.testing.package.submodule.__init__
_______________________________________________________________________________
_______________________ entrypoint: test_importall[227] _______________________
def check_import(modpath):
print "checking import", modpath
E assert __import__(modpath)
> ImportError: No module named package.submodule.pak.__init__
[/tmp/pylib/py/misc/testing/test_initpkg.py:67]
- - - - - - - - - - - - - [227]: recorded stdout - - - - - - - - - - - - - -
checking import py.__.apigen.tracer.testing.package.submodule.pak.__init__
_______________________________________________________________________________
_______________________ entrypoint: test_importall[228] _______________________
def check_import(modpath):
print "checking import", modpath
E assert __import__(modpath)
> ImportError: No module named package.submodule.pak.mod
[/tmp/pylib/py/misc/testing/test_initpkg.py:67]
- - - - - - - - - - - - - [228]: recorded stdout - - - - - - - - - - - - - -
checking import py.__.apigen.tracer.testing.package.submodule.pak.mod
_______________________________________________________________________________
===== tests finished: 1256 passed, 5 failed, 55 skipped in 154.12 seconds =====
inserting into sys.path: /tmp/pylib
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pytest-dev/attachments/20061026/79a1c53d/attachment.html>
More information about the Pytest-dev
mailing list