diff options
author | INADA Naoki <inada-n@klab.com> | 2012-12-29 11:24:25 +0900 |
---|---|---|
committer | INADA Naoki <inada-n@klab.com> | 2012-12-29 11:24:25 +0900 |
commit | 593c832ab00372b4a44dd47de94e4c2546fc1193 (patch) | |
tree | a24b9b2454f4fe30c2262f7839ec66c286036de6 /test/test_case.py | |
parent | d57e369258a388ee64ad900ee7e975da25ca36ec (diff) | |
download | msgpack-python-593c832ab00372b4a44dd47de94e4c2546fc1193.tar.gz |
Use py.test instead of nosetests.
Diffstat (limited to 'test/test_case.py')
-rw-r--r-- | test/test_case.py | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/test/test_case.py b/test/test_case.py index 9cbf9bd..5a4bb6c 100644 --- a/test/test_case.py +++ b/test/test_case.py @@ -1,15 +1,14 @@ #!/usr/bin/env python # coding: utf-8 -from nose import main -from nose.tools import * from msgpack import packb, unpackb def check(length, obj): v = packb(obj) - assert_equal(len(v), length, "%r length should be %r but get %r" % (obj, length, len(v))) - assert_equal(unpackb(v, use_list=0), obj) + assert len(v) == length, \ + "%r length should be %r but get %r" % (obj, length, len(v)) + assert unpackb(v, use_list=0) == obj def test_1(): for o in [None, True, False, 0, 1, (1 << 6), (1 << 7) - 1, -1, @@ -70,8 +69,8 @@ def test_array32(): def match(obj, buf): - assert_equal(packb(obj), buf) - assert_equal(unpackb(buf, use_list=0), obj) + assert packb(obj) == buf + assert unpackb(buf, use_list=0) == obj def test_match(): cases = [ @@ -99,7 +98,5 @@ def test_match(): match(v, p) def test_unicode(): - assert_equal(b'foobar', unpackb(packb('foobar'), use_list=1)) + assert unpackb(packb('foobar'), use_list=1) == b'foobar' -if __name__ == '__main__': - main() |