Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions test/torchaudio_unittest/functional/functional_cpu_test.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import math
import warnings

import torch
import torchaudio
import torchaudio.functional as F
from parameterized import parameterized
import pytest
import itertools

from torchaudio_unittest import common_utils
Expand Down Expand Up @@ -33,17 +33,20 @@ class TestSpectrogramFloat64(Spectrogram, common_utils.PytorchTestCase):

class TestCreateFBMatrix(common_utils.TorchaudioTestCase):
def test_no_warning_high_n_freq(self):
with pytest.warns(None) as w:
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always")
F.create_fb_matrix(288, 0, 8000, 128, 16000)
assert len(w) == 0

def test_no_warning_low_n_mels(self):
with pytest.warns(None) as w:
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always")
F.create_fb_matrix(201, 0, 8000, 89, 16000)
assert len(w) == 0

def test_warning(self):
with pytest.warns(None) as w:
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always")
F.create_fb_matrix(201, 0, 8000, 128, 16000)
assert len(w) == 1

Expand Down
2 changes: 0 additions & 2 deletions test/torchaudio_unittest/librosa_compatibility_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
import librosa
import scipy

import pytest

from torchaudio_unittest import common_utils


Expand Down