Skip to content

Instantly share code, notes, and snippets.

@nekoya
Created March 13, 2014 06:12
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/9522681 to your computer and use it in GitHub Desktop.
Save nekoya/9522681 to your computer and use it in GitHub Desktop.
from nose.tools import eq_, assert_equal
a = [1, 2, 3]
b = [1, 5, 3]
def test_eq():
eq_(a, b)
def test_assert_equal():
assert_equal(a, b)
"""
nose.config: INFO: Ignoring files matching ['^\\.', '^_', '^setup\\.py$']
test_assertion.test_eq ... FAIL
test_assertion.test_assert_equal ... FAIL
======================================================================
FAIL: test_assertion.test_eq
----------------------------------------------------------------------
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 7, in test_eq
eq_(a, b)
AssertionError: [1, 2, 3] != [1, 5, 3]
======================================================================
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 10, in test_assert_equal
assert_equal(a, b)
AssertionError: Lists differ: [1, 2, 3] != [1, 5, 3]
First differing element 1:
2
5
- [1, 2, 3]
? ^
+ [1, 5, 3]
? ^
----------------------------------------------------------------------
Ran 2 tests in 0.001s
FAILED (failures=2)
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment