Skip to content

Instantly share code, notes, and snippets.

@nekoya
Created March 13, 2014 09:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nekoya/9525030 to your computer and use it in GitHub Desktop.
Save nekoya/9525030 to your computer and use it in GitHub Desktop.
from nose.tools import assert_equal
a = []
b = []
for i in xrange(1000):
a.append(i)
b.append(i)
a.append('a')
def test_assert_equal():
assert_equal(a, b)
"""
nose.config: INFO: Ignoring files matching ['^\\.', '^_', '^setup\\.py$']
test_assertion.test_assert_equal ... FAIL
======================================================================
FAIL: test_assertion.test_assert_equal
----------------------------------------------------------------------
Traceback (most recent call last):
File "/kauli/common/python27/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/kauli/dsp/test_assertion.py", line 13, in test_assert_equal
assert_equal(a, b)
AssertionError: Lists differ: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9,... != [0, 1, 2, 3, 4, 5, 6, 7, 8, 9,...
First list contains 1 additional elements.
First extra element 1000:
a
Diff is 7924 characters long. Set self.maxDiff to None to see it.
----------------------------------------------------------------------
Ran 1 test in 0.011s
FAILED (failures=1)
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment