Skip to content
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

bpo-31985: Deprecate aifc.openfp #4344

Merged
merged 5 commits into from
Nov 10, 2017
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Switch to using assertWarns
By using assertWarns we no longer need to check the number of warnings or
the category of the warning, as assertWarns already handles that for us.
  • Loading branch information
briancurtin committed Nov 9, 2017
commit ebe685d2bf95d990b0e6a907f166fb1d921cc3a9
6 changes: 1 addition & 5 deletions Lib/test/test_aifc.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,9 @@ class AifcMiscTest(audiotests.AudioTests, unittest.TestCase):
def test_openfp_deprecated(self, mock_open):
arg = "arg"
mode = "mode"
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always")
with self.assertWarns(DeprecationWarning):
aifc.openfp(arg, mode=mode)

self.assertTrue(len(w) == 1)
self.assertTrue(issubclass(w[0].category, DeprecationWarning))

mock_open.assert_called_with(arg, mode=mode)

def test_skipunknown(self):
Expand Down