From: Paul Brossier Date: Mon, 2 May 2016 10:46:30 +0000 (+0200) Subject: python/tests/test_cvec.py: simplify, use nose2 X-Git-Tag: 0.4.4~300^2~143 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=9f8cd9f3633dab32802af562fc55959decf4ead6;p=aubio.git python/tests/test_cvec.py: simplify, use nose2 --- diff --git a/python/tests/test_cvec.py b/python/tests/test_cvec.py index 1f3c9eca..00751c7a 100755 --- a/python/tests/test_cvec.py +++ b/python/tests/test_cvec.py @@ -1,16 +1,16 @@ #! /usr/bin/env python -from numpy.testing import TestCase, run_module_suite +from numpy.testing import TestCase from numpy.testing import assert_equal, assert_almost_equal -from aubio import cvec -from numpy import array, shape, pi +from aubio import cvec, float_type +import numpy as np class aubio_cvec_test_case(TestCase): def test_vector_created_with_zeroes(self): a = cvec(10) - shape(a.norm) - shape(a.phas) + assert_equal(a.norm.shape[0], 10 / 2 + 1) + assert_equal(a.phas.shape[0], 10 / 2 + 1) a.norm[0] assert_equal(a.norm, 0.) assert_equal(a.phas, 0.) @@ -41,11 +41,11 @@ class aubio_cvec_test_case(TestCase): def test_assign_cvec_phas_slice(self): spec = cvec(1024) - spec.phas[39:-1] = -pi + spec.phas[39:-1] = -np.pi assert_equal(spec.phas[0:39], 0) - assert_equal(spec.phas[39:-1], -pi) + assert_equal(spec.phas[39:-1], -np.pi) assert_equal(spec.norm, 0) if __name__ == '__main__': - from unittest import main + from nose2 import main main()