File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import unittest
22from test import audiotests
33from test import support
4- from test .support import os_helper
5- import contextlib
64import io
5+ import os
76import struct
87import sys
98import wave
@@ -198,12 +197,11 @@ def test_read_wrong_sample_width(self):
198197 with self .assertRaisesRegex (wave .Error , 'bad sample width' ):
199198 wave .open (io .BytesIO (b ))
200199
201- def test_write_to_protected_location (self ):
200+ def test_open_in_write_raises (self ):
202201 # gh-136523: Wave_write.__del__ should not throw
203202 with support .catch_unraisable_exception () as cm :
204- with contextlib .suppress (OSError ):
205- with os_helper .temp_dir () as path :
206- wave .open (path , "wb" )
203+ with self .assertRaises (OSError ):
204+ wave .open (os .curdir , "wb" )
207205 support .gc_collect ()
208206 self .assertIsNone (cm .unraisable )
209207
You can’t perform that action at this time.
0 commit comments