merge the benjamins and my changes, accidentally caused a new remote head
--HG-- branch : trunk
This commit is contained in:
commit
d75f7b2dd7
|
@ -68,6 +68,10 @@ operator_map = {
|
||||||
ast.LtE : "<=",
|
ast.LtE : "<=",
|
||||||
ast.Gt : ">",
|
ast.Gt : ">",
|
||||||
ast.GtE : ">=",
|
ast.GtE : ">=",
|
||||||
|
ast.Is : "is",
|
||||||
|
ast.IsNot : "is not",
|
||||||
|
ast.In : "in",
|
||||||
|
ast.NotIn : "not in"
|
||||||
}
|
}
|
||||||
|
|
||||||
unary_map = {
|
unary_map = {
|
||||||
|
|
|
@ -65,6 +65,22 @@ def test_assert_multiline_2():
|
||||||
s = str(e)
|
s = str(e)
|
||||||
assert s.startswith('assert 2 ==')
|
assert s.startswith('assert 2 ==')
|
||||||
|
|
||||||
|
def test_in():
|
||||||
|
try:
|
||||||
|
assert "hi" in [1, 2]
|
||||||
|
except AssertionError:
|
||||||
|
e = exvalue()
|
||||||
|
s = str(e)
|
||||||
|
assert s.startswith("assert 'hi' in")
|
||||||
|
|
||||||
|
def test_is():
|
||||||
|
try:
|
||||||
|
assert 1 is 2
|
||||||
|
except AssertionError:
|
||||||
|
e = exvalue()
|
||||||
|
s = str(e)
|
||||||
|
assert s.startswith("assert 1 is 2")
|
||||||
|
|
||||||
def test_assert_non_string_message():
|
def test_assert_non_string_message():
|
||||||
class A:
|
class A:
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
|
|
@ -120,7 +120,7 @@ class Rest(AbstractNode):
|
||||||
return ""
|
return ""
|
||||||
link_texts = []
|
link_texts = []
|
||||||
# XXX this could check for duplicates and remove them...
|
# XXX this could check for duplicates and remove them...
|
||||||
for link, target in self.links.iteritems():
|
for link, target in self.links.items():
|
||||||
link_texts.append(".. _`%s`: %s" % (escape(link), target))
|
link_texts.append(".. _`%s`: %s" % (escape(link), target))
|
||||||
return "\n" + "\n".join(link_texts) + "\n\n"
|
return "\n" + "\n".join(link_texts) + "\n\n"
|
||||||
|
|
||||||
|
@ -401,7 +401,7 @@ class Directive(Paragraph):
|
||||||
txt = super(Directive, self).text()
|
txt = super(Directive, self).text()
|
||||||
txt = '.. %s::%s' % (self.name, txt[namechunksize + 3:],)
|
txt = '.. %s::%s' % (self.name, txt[namechunksize + 3:],)
|
||||||
options = '\n'.join([' :%s: %s' % (k, v) for (k, v) in
|
options = '\n'.join([' :%s: %s' % (k, v) for (k, v) in
|
||||||
self.options.iteritems()])
|
self.options.items()])
|
||||||
if options:
|
if options:
|
||||||
txt += '\n%s' % (options,)
|
txt += '\n%s' % (options,)
|
||||||
|
|
||||||
|
|
|
@ -441,7 +441,7 @@ def folded_skips(skipped):
|
||||||
key = entry.path, entry.lineno, entry.message
|
key = entry.path, entry.lineno, entry.message
|
||||||
d.setdefault(key, []).append(event)
|
d.setdefault(key, []).append(event)
|
||||||
l = []
|
l = []
|
||||||
for key, events in d.iteritems():
|
for key, events in d.items():
|
||||||
l.append((len(events),) + key)
|
l.append((len(events),) + key)
|
||||||
return l
|
return l
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue