New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unify audio modules tests #63119
Comments
Three audio modules, aifc, sunau and wave, have similar interfaces and poor tests. The proposed patch introduces new file Lib/test/audiotests.py with common audio tests. New testing exposes some bugs and discrepancy between different audio modules. For example aifc uses bytes for compression type and name, while sunau and wave use strings (bpo-8934). aifc closes underlied file object on close(), while sunau and wave don't. wave rounds a framerate, while aifc and sunau truncate it. Different modules have different behaviors when process framedata with length which is not divisible by frame size. |
I love this idea! I was thinking while working on sunau/aifc/wave patches that we can do more than this, unify the entire audio modules, |
New changeset 61ca4732399b by Serhiy Storchaka in branch 'default': |
Patch updated. It now contains tests for all supported encoding formats (PCM8-32, u-Law, A-Law). |
Patch updated. Now files created in external program (Audacity) are used for testing. This exposed yet one bug, in the aifc module (bpo-19131). |
New changeset 3303d735058f by Serhiy Storchaka in branch '2.7': New changeset b7eae747385c by Serhiy Storchaka in branch '3.3': |
New changeset a9f967c8d002 by Serhiy Storchaka in branch '2.7': |
New changeset ee7563b07c6f by Serhiy Storchaka in branch '3.3': New changeset fc418ecd8777 by Serhiy Storchaka in branch 'default': |
Tests fail for 2.7 on the koobs-freebsd9 and koobs-freebsd10 buildbots since a9f967c8d002db364021a5fb1c9926a27029e849 Taking a snapshot of the output here for reference: test_aifc Warning: bad COMM chunk size <snip> 363 tests OK. <snip> Re-running failed tests in verbose mode <snip> test_read_comm_kludge_compname_even (test.test_aifc.AIFCLowLevelTest) ... Warning: bad COMM chunk size ---------------------------------------------------------------------- OK |
Is unexpected output considered as test failing? The aifc module uses bare print to output these "warnings" to stdout. Here is a patch which uses captured_stdout(). |
In 2.7 unexpected output is a test failure, yes. In 3.x we removed that check. But I wonder if that was wise :) (We did it for technical reasons when adding other features to regrtest). Yes, using captured_stdout and checking for the expected warnings would be a better test, IMO. |
Some new (I assume) ResourceWarnings from test_wave: /home/gbr/devel/python/Lib/unittest/case.py:571: ResourceWarning: unclosed file <_io.BufferedWriter name='@test_1974_tmp'> |
New changeset 164a60cce934 by Serhiy Storchaka in branch '2.7': New changeset 9eecd00ffc28 by Serhiy Storchaka in branch '3.3': New changeset d168f094d16d by Serhiy Storchaka in branch 'default': |
New changeset fd7752db1e54 by Serhiy Storchaka in branch '2.7': New changeset 2850fc02f324 by Serhiy Storchaka in branch '3.3': New changeset 835c6ea487b1 by Serhiy Storchaka in branch 'default': |
Actually the checks left, but there was no check for warning message. Now they are added.
Thank you Greg for this report. Yes, these warnings are new. The tests only existed for the aifc module (which always closes externally opened file), and when I extended it to other modules I forgot close externally opened files. Hope it now fixed. |
The new tests fail when run from an installed Python. You also need to add all of the new test directories to LIBSUBDIRS for the libinstall target in Makefile.pre.in. |
New changeset de1f62a55648 by Serhiy Storchaka in branch '2.7': New changeset 865bab7387f2 by Serhiy Storchaka in branch '3.3': New changeset 4d5143ff58ea by Serhiy Storchaka in branch 'default': |
It looks like test_wave is still failing on PPC64 PowerLinux: http://buildbot.python.org/all/builders/PPC64%20PowerLinux%203.x/builds/850/steps/test/logs/stdio |
Thank you David. Fixed in bpo-19276. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: