[svn r37425] Fixed Code.__ne__() (wrong function sig, missing 'other' argument).
--HG-- branch : trunk
This commit is contained in:
parent
d929f633a7
commit
9539e49743
|
@ -15,7 +15,7 @@ class Code(object):
|
|||
def __eq__(self, other):
|
||||
return self.raw == other.raw
|
||||
|
||||
def __ne__(self):
|
||||
def __ne__(self, other):
|
||||
return not self == other
|
||||
|
||||
def new(self, rec=False, **kwargs):
|
||||
|
|
|
@ -8,6 +8,12 @@ def test_newcode():
|
|||
newco = code.new()
|
||||
assert co == newco
|
||||
|
||||
def test_ne():
|
||||
code1 = py.code.Code(compile('foo = "bar"', '', 'exec'))
|
||||
assert code1 == code1
|
||||
code2 = py.code.Code(compile('foo = "baz"', '', 'exec'))
|
||||
assert code2 != code1
|
||||
|
||||
def test_newcode_unknown_args():
|
||||
code = py.code.Code(compile("", '', 'exec'))
|
||||
py.test.raises(TypeError, 'code.new(filename="hello")')
|
||||
|
|
Loading…
Reference in New Issue