diff options
Diffstat (limited to 'Lib/test')
| -rw-r--r-- | Lib/test/audiotests.py | 12 | ||||
| -rw-r--r-- | Lib/test/test_aifc.py | 5 | ||||
| -rw-r--r-- | Lib/test/test_pyclbr.py | 2 | ||||
| -rw-r--r-- | Lib/test/test_sunau.py | 4 | ||||
| -rw-r--r-- | Lib/test/test_wave.py | 4 |
5 files changed, 25 insertions, 2 deletions
diff --git a/Lib/test/audiotests.py b/Lib/test/audiotests.py index d3e8e9e..0dad017 100644 --- a/Lib/test/audiotests.py +++ b/Lib/test/audiotests.py @@ -1,6 +1,7 @@ from test.support import findfile, TESTFN, unlink import array import io +from unittest import mock import pickle @@ -49,6 +50,17 @@ class AudioTests: self.assertEqual(pickle.loads(dump), params) +class AudioMiscTests(AudioTests): + + def test_openfp_deprecated(self): + arg = "arg" + mode = "mode" + with mock.patch(f"{self.module.__name__}.open") as mock_open, \ + self.assertWarns(DeprecationWarning): + self.module.openfp(arg, mode=mode) + mock_open.assert_called_with(arg, mode=mode) + + class AudioWriteTests(AudioTests): def create_file(self, testfile): diff --git a/Lib/test/test_aifc.py b/Lib/test/test_aifc.py index a731a51..a064a32 100644 --- a/Lib/test/test_aifc.py +++ b/Lib/test/test_aifc.py @@ -7,6 +7,7 @@ import io import sys import struct import aifc +import warnings class AifcTest(audiotests.AudioWriteTests, @@ -144,7 +145,9 @@ class AifcALAWTest(AifcTest, unittest.TestCase): frames = byteswap(frames, 2) -class AifcMiscTest(audiotests.AudioTests, unittest.TestCase): +class AifcMiscTest(audiotests.AudioMiscTests, unittest.TestCase): + module = aifc + def test_skipunknown(self): #Issue 2245 #This file contains chunk types aifc doesn't recognize. diff --git a/Lib/test/test_pyclbr.py b/Lib/test/test_pyclbr.py index 238eb71..eaab591 100644 --- a/Lib/test/test_pyclbr.py +++ b/Lib/test/test_pyclbr.py @@ -223,6 +223,8 @@ class PyclbrTest(TestCase): cm('random', ignore=('Random',)) # from _random import Random as CoreGenerator cm('cgi', ignore=('log',)) # set with = in module cm('pickle', ignore=('partial',)) + # TODO(briancurtin): openfp is deprecated as of 3.7. + # Update this once it has been removed. cm('aifc', ignore=('openfp', '_aifc_params')) # set with = in module cm('sre_parse', ignore=('dump', 'groups', 'pos')) # from sre_constants import *; property cm('pdb') diff --git a/Lib/test/test_sunau.py b/Lib/test/test_sunau.py index bc1f46c..966224b 100644 --- a/Lib/test/test_sunau.py +++ b/Lib/test/test_sunau.py @@ -117,5 +117,9 @@ class SunauULAWTest(SunauTest, unittest.TestCase): frames = byteswap(frames, 2) +class SunauMiscTests(audiotests.AudioMiscTests, unittest.TestCase): + module = sunau + + if __name__ == "__main__": unittest.main() diff --git a/Lib/test/test_wave.py b/Lib/test/test_wave.py index 8666f72..c5d2e02 100644 --- a/Lib/test/test_wave.py +++ b/Lib/test/test_wave.py @@ -103,7 +103,9 @@ class WavePCM32Test(WaveTest, unittest.TestCase): frames = byteswap(frames, 4) -class MiscTestCase(unittest.TestCase): +class MiscTestCase(audiotests.AudioMiscTests, unittest.TestCase): + module = wave + def test__all__(self): blacklist = {'WAVE_FORMAT_PCM'} support.check__all__(self, wave, blacklist=blacklist) |
