Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
Torchaudio
Commits
0d40a52e
Unverified
Commit
0d40a52e
authored
Jan 20, 2021
by
Nicolas Hug
Committed by
GitHub
Jan 20, 2021
Browse files
Remove use of pytest in test code (#1188)
parent
107718c8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
test/torchaudio_unittest/functional/functional_cpu_test.py
test/torchaudio_unittest/functional/functional_cpu_test.py
+7
-4
test/torchaudio_unittest/librosa_compatibility_test.py
test/torchaudio_unittest/librosa_compatibility_test.py
+0
-2
No files found.
test/torchaudio_unittest/functional/functional_cpu_test.py
View file @
0d40a52e
import
math
import
math
import
warnings
import
torch
import
torch
import
torchaudio
import
torchaudio
import
torchaudio.functional
as
F
import
torchaudio.functional
as
F
from
parameterized
import
parameterized
from
parameterized
import
parameterized
import
pytest
import
itertools
import
itertools
from
torchaudio_unittest
import
common_utils
from
torchaudio_unittest
import
common_utils
...
@@ -33,17 +33,20 @@ class TestSpectrogramFloat64(Spectrogram, common_utils.PytorchTestCase):
...
@@ -33,17 +33,20 @@ class TestSpectrogramFloat64(Spectrogram, common_utils.PytorchTestCase):
class
TestCreateFBMatrix
(
common_utils
.
TorchaudioTestCase
):
class
TestCreateFBMatrix
(
common_utils
.
TorchaudioTestCase
):
def
test_no_warning_high_n_freq
(
self
):
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
)
F
.
create_fb_matrix
(
288
,
0
,
8000
,
128
,
16000
)
assert
len
(
w
)
==
0
assert
len
(
w
)
==
0
def
test_no_warning_low_n_mels
(
self
):
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
)
F
.
create_fb_matrix
(
201
,
0
,
8000
,
89
,
16000
)
assert
len
(
w
)
==
0
assert
len
(
w
)
==
0
def
test_warning
(
self
):
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
)
F
.
create_fb_matrix
(
201
,
0
,
8000
,
128
,
16000
)
assert
len
(
w
)
==
1
assert
len
(
w
)
==
1
...
...
test/torchaudio_unittest/librosa_compatibility_test.py
View file @
0d40a52e
...
@@ -17,8 +17,6 @@ if LIBROSA_AVAILABLE:
...
@@ -17,8 +17,6 @@ if LIBROSA_AVAILABLE:
import
librosa
import
librosa
import
scipy
import
scipy
import
pytest
from
torchaudio_unittest
import
common_utils
from
torchaudio_unittest
import
common_utils
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment