Ignore:
Timestamp:
Mar 31, 2019, 9:58:02 PM (5 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/constantq
Children:
9492313a
Parents:
868c6b8 (diff), f55630c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into feature/constantq

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/tests/test_hztomel.py

    r868c6b8 rdfe6ab6  
    44from numpy.testing import TestCase
    55from numpy.testing import assert_equal, assert_almost_equal
     6from _tools import assert_warns
    67import numpy as np
    78import aubio
     
    3839
    3940    def test_meltohz_negative(self):
    40         # TODO add assert_warns
    41         assert_equal(meltohz(-1), 0)
     41        with assert_warns(UserWarning):
     42            assert_equal(meltohz(-1), 0)
    4243
    4344    def test_hztomel_negative(self):
    44         # TODO add assert_warns
    45         assert_equal(hztomel(-1), 0)
     45        with assert_warns(UserWarning):
     46            assert_equal(hztomel(-1), 0)
    4647
    4748
     
    5859
    5960    def test_meltohz_negative(self):
    60         # TODO add assert_warns
    61         assert_equal(meltohz(-1, htk=True), 0)
     61        with assert_warns(UserWarning):
     62            assert_equal(meltohz(-1, htk=True), 0)
    6263        assert_almost_equal(meltohz(2000, htk=True), 3428.7, decimal=1)
    6364        assert_almost_equal(meltohz(1000, htk=True), 1000., decimal=1)
    6465
    6566    def test_hztomel_negative(self):
    66         # TODO add assert_warns
    67         assert_equal(hztomel(-1, htk=True), 0)
     67        with assert_warns(UserWarning):
     68            assert_equal(meltohz(-1, htk=True), 0)
     69        with assert_warns(UserWarning):
     70            assert_equal(hztomel(-1, htk=True), 0)
    6871        assert_almost_equal(hztomel(1000, htk=True), 1000., decimal=1)
    6972
Note: See TracChangeset for help on using the changeset viewer.