-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorganize test packages and remove custom runners
* Custom runners are unneeded with the builtin "unittest discovery" command. * Reorganize test packages and avoid conflicts with the builtin `unittest` module. * Remove unneeded path and suite boilerplate from tests.
- Loading branch information
Showing
34 changed files
with
55 additions
and
302 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
File renamed without changes.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 3 additions & 8 deletions
11
unittest/test_composition.py → tests/unit/containers/test_composition.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,12 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import absolute_import | ||
|
||
# -*- coding: utf-8 -*- | ||
import sys | ||
import unittest | ||
|
||
sys.path += ["../"] | ||
# noinspection PyUnresolvedReferences | ||
from mingus.containers.composition import Composition | ||
import unittest | ||
|
||
|
||
class test_Composition(unittest.TestCase): | ||
def setUp(self): | ||
pass | ||
|
||
|
||
def suite(): | ||
return unittest.TestLoader().loadTestsFromTestCase(test_Composition) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 3 additions & 8 deletions
11
unittest/test_suite.py → tests/unit/containers/test_suite.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,12 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import absolute_import | ||
|
||
# -*- coding: utf-8 -*- | ||
import sys | ||
import unittest | ||
|
||
sys.path += ["../"] | ||
# noinspection PyUnresolvedReferences | ||
from mingus.containers.suite import Suite | ||
import unittest | ||
|
||
|
||
class test_Suite(unittest.TestCase): | ||
def setUp(self): | ||
pass | ||
|
||
|
||
def suite(): | ||
return unittest.TestLoader().loadTestsFromTestCase(test_Suite) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,25 @@ | ||
from __future__ import absolute_import | ||
|
||
# -*- coding: utf-8 -*- | ||
import sys | ||
from __future__ import absolute_import | ||
|
||
sys.path += ["../"] | ||
import unittest | ||
|
||
from pkg_resources import resource_filename | ||
|
||
import mingus.extra.fft as fft | ||
from mingus.containers import * | ||
|
||
|
||
class test_fft(unittest.TestCase): | ||
def setUp(self): | ||
(self.data, self.freq, self.bits) = fft.data_from_file("440_sine_clean.wav") | ||
(self.data, self.freq, self.bits) = fft.data_from_file( | ||
resource_filename(__name__, "440_sine_clean.wav") | ||
) | ||
|
||
def test_find_Note(self): | ||
self.assertEqual(Note("A"), fft.find_Note(self.data, self.freq, self.bits)) | ||
|
||
def test_find_melody(self): | ||
self.assertEqual( | ||
[(Note("A-4"), 86), (Note("A-5"), 86)], | ||
fft.find_melody("440_880_clean.wav", 512)[:2], | ||
fft.find_melody(resource_filename(__name__, "440_880_clean.wav"), 512)[:2], | ||
) | ||
|
||
|
||
def suite(): | ||
return unittest.TestLoader().loadTestsFromTestCase(test_fft) |
Oops, something went wrong.